简体   繁体   English

SAS 企业指南 - 如何从网站下载 ZIP 文件,提取其内容并运行它?

[英]SAS Enterprise Guide - How can I download a ZIP file from a website, extract its contents and run it?

I would like to have a task to download a continuously updated.ZIP data file from a specific website, extract its contents and run the file inside.我想有一个任务从特定网站下载一个持续更新的 .ZIP 数据文件,提取其内容并运行其中的文件。

I am looking for a program code that performs these tasks and, so to speak, if the data on the website is updated, then my data file is also updated with it.我正在寻找执行这些任务的程序代码,可以说,如果网站上的数据更新了,那么我的数据文件也会随之更新。

How can I do it?我该怎么做?

Please help.请帮忙。 SAS Enterprise Guide 8.2 SAS企业指南8.2

I didn't find a solution for it.我没有找到解决方案。

Read Chris method here for reading a zip file using filename statement: https://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/在此处阅读 Chris 方法以使用文件名语句读取 zip 文件: https://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/

Chris is the community director at SAS (something like that). Chris 是 SAS(类似电话)的社区主管。 A zip file will be locked on an update. zip 文件将在更新时被锁定。 Check the file date and store the date somewhere so you can see if it changed.检查文件日期并将日期存储在某处,以便您可以查看它是否已更改。

There are lots of ways to approach your problem and I dont know your constraints.有很多方法可以解决您的问题,但我不知道您的限制。 Start with Chris' post and work from there.从 Chris 的帖子开始,然后从那里开始工作。

You could download the zip using proc http您可以使用proc http

This macro will let you unzip it: https://core.sasjs.io/mp__unzip_8sas.html这个宏会让你解压它: https://core.sasjs.io/mp__unzip_8sas.html

And this macro will give you the recursive directory contents: https://core.sasjs.io/mp__tree_8sas.html这个宏会给你递归目录内容: https://core.sasjs.io/mp__tree_8sas.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM