DATA Step, Macro, Functions and more

reading in zipped datasets

Posts: 29

reading in zipped datasets

I have several datasets stored in a zip file. Usually I unzip the datasets and place them into my library, and read them in through the library reference. Is there a way to access the zipped files directly through SAS?

I tried the following code:

filename in saszipam 'C:\' ;

data follow;
infile in(;

And got the following error message in my log:

ERROR: Read Access Violation In Task [ DATASTEP )
Exception occurred at (62A22BE2)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
62A22BE2 057CFC18 saszipam:mcn_main+0x1BE2
62A22F6F 057CFCE4 saszipam:mcn_main+0x1F6F
67990076 057CFD20 sasxkern:mcn_main+0x3F076
6723F48A 057CFECC sasdsx:mcn_main+0xE48A
6723EE73 057CFEF8 sasdsx:mcn_main+0xDE73
6723142A 057CFF3C sasdsx:mcn_main+0x42A
673115B0 057CFF88 sasds:mcn_main+0x5B0
67E228F2 057CFFA0 sashost:Main+0xBE72
67E26A00 057CFFB4 sashost:Main+0xFF80
7C80B683 057CFFEC kernel32:GetModuleFileNameA+0x1B4

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FOLLOW may be incomplete. When this step was stopped there were 0
observations and 0 variables.
WARNING: Data set WORK.FOLLOW was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.77 seconds
cpu time 0.06 seconds

Thank you!!
Trusted Advisor
Posts: 2,125

Re: reading in zipped datasets

You can read raw data from WinZip files. See . This uses the PIPE option which still requires disk storage, but it is immediately deleted.

Similarly, this SUGI paper has examples , though it extracts the files to temporary storage.

I doubt that you can read SAS datasets (.sas7bdat extensions) that way because they need to be direct access.
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation