BookmarkSubscribeRSS Feed
SamT
Calcite | Level 5
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;

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

Input
...;
Keep ....;
Run;


Thanks Guys!
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
From the SAS support website, here is an SGF conference paper on the topic of reading compressed files:

http://www2.sas.com/proceedings/sugi31/155-31.pdf

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:
read zip files site:sas.com
SamT
Calcite | Level 5
Had a read of that Scott and I can't work out how to use it or change it to what I need...

(extract)
"...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\11022011.zip. 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 "11022011.zip";

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

Thanks for your help mate.

Sam
Robert_Bardos
Fluorite | Level 6
What was that "x" command (having just a path/directory as an argument) supposed to do?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3364 views
  • 0 likes
  • 3 in conversation