• Narrow screen resolution
  • Wide screen resolution
  • Fluid screen
  • style1 color
  • style2 color
  • style3 color

SAS Portlets, Widgets, Themes and Tutorials for sale

Blogging about all things SAS

 

Posts Tagged ‘SAS winzip zip’

Making SAS Zippy’d doh da

Tuesday, June 24th, 2008

I often see people on the SAS forums asking how to read a zip file in SAS.

I came across a great set of tips over at the Computer Measurement Group

And one of the tips was the following on how to access zip files via SAS code.


Using the ZIP engine to read zip filesThere is a currently undocumented filename engine available in SAS 9 that can be used to read from compressed ZIP files directly. You simply specify the engine “SASZIPAM” on a filename statement, and when referring to it you must specify the file within it that you wish to read.

In the example below “tomcat.zip” contains a number of files. I want to read “tomat.log” and therefore specify “in(tomcat.log)”, where “in” is the libref and “tomcat.log” is the file I will read from the zip file.

Sample SAS Program

filename in saszipam ‘c:\tomcat.zip’;

data _null_;

infile in(tomcat.log);

input ;

put _infile_;

if _n_>10 then

stop ;

run;


Easy peasy!