Hi All,
I am trying to read zip file which has lot of sas datasets. I want to extract all this sas datasets at once and placed them in a folder.
I am successful in reading the content of zip file but not sure how to extract sas datasets from this zip file and placed them in a different folder. Below is the code which reads content of zip file.
filename inzip ZIP "x:\test.zip";
DATA FLS(KEEP=MEMNAME);
FILENAME inzip ZIP "x:\test.zip";
LENGTH MEMNAME $200;
FID=DOPEN("inzip");
IF FID=0 THEN
STOP;
MEMCOUNT=DNUM(FID);
DO I=1 TO MEMCOUNT;
MEMNAME=DREAD(FID,I);
OUTPUT;
END;
RC=DCLOSE(FID);
RUN;
proc print data = fls ;
run;
I could not fine anything which specifically does this task. I example of reading excel file and reading one dataset at a time but nothing related to what I need.
I'd recommend taking the example that does one file and figure out how to generalize it to all.
X commands definitely work though.
@Leo9 wrote:
I could not fine anything which specifically does this task. I example of reading excel file and reading one dataset at a time but nothing related to what I need.
My approach to something like this would be to
1) us appropriate tool to unzip to desired location with system tools.
2) assign a library to that location.
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: