BookmarkSubscribeRSS Feed
Linlin
Lapis Lazuli | Level 10

Thank you very much!  - Linlin

6 REPLIES 6
Patrick
Opal | Level 21

Something like below should work.

filename <fileref> pipe '<unzip command eg. using 7zip or whatever is available>';

data want;

     infile <fileref> ...;

     input...;

run;

Linlin
Lapis Lazuli | Level 10

Hi Patrick,

Thank you for your reply. But I still don't know how to write the code.

Patrick
Opal | Level 21

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:

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

PGStats
Opal | Level 21

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

PG
Patrick
Opal | Level 21

@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.

Linlin
Lapis Lazuli | Level 10

Hi PG and Patrick,

Thank you very much for your help!  - Linlin

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 1715 views
  • 6 likes
  • 3 in conversation