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?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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