Help using Base SAS procedures

Importing Files from .zip

Occasional Contributor
Posts: 16

Importing Files from .zip

Hello there,

I was wondering if it was possible to import .dat files from inside a .zip folder.

The only way I've been able to manage the import is by copy and pasting these files out of the zip folder.

I've been using an infile statement to import...

Data work.dat;

'\\int\Updates\folder\SPEC.dat' LRECL = 452 Firstobs = 2;

Keep ....;

Thanks Guys!
Super Contributor
Super Contributor
Posts: 3,176

Re: Importing Files from .zip

From the SAS support website, here is an SGF conference paper on the topic of reading compressed files:

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:
read zip files
Occasional Contributor
Posts: 16

Re: Importing Files from .zip

Had a read of that Scott and I can't work out how to use it or change it to what I need...

"...let’s put all you need in the same directory: the SAS programs we are
going to test, the uncompressed text files, the archives (compressed files) and the tools 7za.exe and gzip.exe...."

I think if I asked for the IT guys here at work if I could do that their heads would explode.

This is what I've been trying to run and getting an ERROR: Insufficient authorization to access c:\windows\system32\ The thing I don't fully understand is where in my script am I asking for it to look in that directory.

Options nodate noxwait;
%Let MyDir = \\int\Collaborate\PI\Portfoli\FTP Transfer;
x "&MyDir";
FileName FTPTRANS Saszipam "";

Data Rwork.GIOSPEC (index = (Nvic));
LRECL = 452 Firstobs = 2;
%Let _EFIERR_ = 0;
Input ....

Thanks for your help mate.

Frequent Contributor
Posts: 106

Re: Importing Files from .zip

What was that "x" command (having just a path/directory as an argument) supposed to do?
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation