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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 2232 views
  • 0 likes
  • 3 in conversation