BookmarkSubscribeRSS Feed
mjcm0030
Calcite | Level 5

Hi, I'm new to SAS and I'm wondering how could I download a set of datasets in zips from a website, and then importing them to SAS.

 

The website is https://s3.amazonaws.com/tripdata/index.html, and can be access like:
                      https://s3.amazonaws.com/tripdata/ + id of every file (example, 201306-citibike-tripdata.zip) and always repeats the name

 

Here, i have the code I'm using, but it only gets 1 zip, decompress, and import into a table. I want it to do it with every file.

 

 

Thank you!!

2 REPLIES 2
Reeza
Super User

You most definitely can do this, but you may need a loop or macro. 

 

Here's an example of how to get the list of files and to access them:

https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in...

 

Basically, get it working for one file then convert that to a macro. Use methods above to get all files listed and then call the macro once for each file.

 


@mjcm0030 wrote:

Hi, I'm new to SAS and I'm wondering how could I download a set of datasets in zips from a website, and then importing them to SAS.

 

The website is https://s3.amazonaws.com/tripdata/index.html, and can be access like:
                      https://s3.amazonaws.com/tripdata/ + id of every file (example, 201306-citibike-tripdata.zip) and always repeats the name

 

Here, i have the code I'm using, but it only gets 1 zip, decompress, and import into a table. I want it to do it with every file.

 

 

Thank you!!


 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2059 views
  • 1 like
  • 3 in conversation