BookmarkSubscribeRSS Feed
AmitKB
Fluorite | Level 6
Hi everyone,
I have a winzip file, i want to read using sas linux. I am geting error.
code:

filename zip1 saszipam '/test/temp1.zip ';
DATA unzip1;
INFILE zip1(temp1.txt) MISSOVER lrecl=32767 obs = 2;
input temp $60;
run;

Error.

ERROR: Invalid data length.
FATAL: Unrecoverable I/O error detected in the execution of the DATA step

Please guide me how i can read the data.

Thanks,

Amit
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Hello - straight from the SAS-hosted tech notes documentation at http://support.sas.com/ here is a document reference I found useful for your circumstances.

Scott Barry
SBBWorks, Inc.

Usage Note 31244: SASZIPAM access method - use at your own risk.
http://support.sas.com/kb/31/244.html
lu
Calcite | Level 5 lu
Calcite | Level 5
HI, Amit
saszipam work only on windows hosts(SAS use dll ).

to read zip file on sas linux you can use pipe in filename statment.
something like

filename zip1 pipe 'unzip -p /test/temp1.zip temp1.txt';

lu.
AmitKB
Fluorite | Level 6
Hi Lu,
Thanks for your response. I have a few questions.

What will your statement do, will it unzip and create a text file.

filename zip1 pipe 'unzip -p /test/temp1.zip temp1.txt';

These is what I would like to do:

1> Read one observation from the zipped file, to get the variables. ( they are separated by |)
2> Then Create a SAS dataset from the zipped file

Thanks for all your help.

Regards,

Amit
lu
Calcite | Level 5 lu
Calcite | Level 5
Hi

filename statment with pipe read zipped file on the fly ,without creat temp file/s.
'unzip -p /test/temp1.zip temp1.txt' is a linux command pipe contens of temp1.txt(zipped file ) in standart output (stdout)

you can write data step like your zipped file wasn't zipped 🙂

lu

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1423 views
  • 0 likes
  • 3 in conversation