Thank you very much! - Linlin
Something like below should work.
filename <fileref> pipe '<unzip command eg. using 7zip or whatever is available>';
data want;
infile <fileref> ...;
input...;
run;
Hi Patrick,
Thank you for your reply. But I still don't know how to write the code.
How I would approach this:
1. Using a command prompt get the unzip command right
2. Unzip the file and get the data step right
3. Paste the unzip command into the filename statement (you will have to get the quoting right here).
4. In the infile statement use the fileref so that it points to the pipe where the filename pipe writes to.
Everything here with examples:
From the 7zip help file: the command line should be something like :
7z x yourFile.zip -so
where 7z is the name of the command line version of 7zip, x means extract and -so means write to standard output stream.
hth
PG
@Linlin
I possibly don't understand what the "asc" in your question stands for. But the main approach remains: You use a non-SAS command to bring the archive into a shape where you can read it with SAS and you write this to a pipe which you then access via SAS.
Hi PG and Patrick,
Thank you very much for your help! - Linlin
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.
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.