BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aman4SAS
Obsidian | Level 7

Hi every one .... please help me to use .gz file attached along with this.

i need to use it by infile and i am working on windows

 

please help me

 

my code is

 

filename hhh pipe "zcat filepath\test.txt.gz";
  
  data test;
    infile hhh firstobs = 2 expandtabs truncover;
    input @1    dd1 yymmdd10.
          @17   dd2 yymmdd10.
          @33   act $1.
          @41   udu 1.
          @49   LC $5.
          @57   cs $3.
          @65   sc $3.
          @73   div 1.
          @81   vol;
    format dd1 dateto date9.;
    area=trim(left(lc));
    if lc=' ' then error 'NO AREA LISTED';
    
  run;

Log window:

 

Stderr output:
'zcat' is not recognized as an internal or external command,
operable program or batch file.
NOTE: 0 records were read from the infile HHH.
NOTE: The data set WORK.TEST has 0 observations and 9 variables.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.04 seconds

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

If the zipping tool you want to use is 7zip then you need also to use the syntax for 7zip (zcat is Gzip syntax).

May be this will help you: http://www2.sas.com/proceedings/sugi31/155-31.pdf

View solution in original post

6 REPLIES 6
MohammadFayaz
Calcite | Level 5

Hello,

In filename, you can use PIPE to handle it.

Patrick
Opal | Level 21

Is gzip installed on your Windows machine? Or any other zipping tool like 7zip?

Whatever you're using I doubt that you just can call the tool using "zcat". In order for Windows to find it you must provide a path (absolute or relative) - or 'cd' to the directory where the executable "lives".

May be below links will help:

https://communities.sas.com/message/114760#114760

https://communities.sas.com/message/169460#169460

ChrisHemedinger
Community Manager

In SAS 9.4 you can use the FILENAME statement, ZIP access method for this.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Aman4SAS
Obsidian | Level 7

yes 7zip installed on my machine... still havining error

 

Stderr output:

'zcat' is not recognized as an internal or external command,

operable program or batch file.

NOTE: 0 records were read from the infile WANTED.

NOTE: The data set WORK.TEST has 0 observations and 9 variables.

NOTE: DATA statement used (Total process time):

real time 0.03 seconds

cpu time 0.00 seconds


Patrick
Opal | Level 21

If the zipping tool you want to use is 7zip then you need also to use the syntax for 7zip (zcat is Gzip syntax).

May be this will help you: http://www2.sas.com/proceedings/sugi31/155-31.pdf

MohammadFayaz
Calcite | Level 5

I run your code under SAS 9.2. It works !

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!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 11234 views
  • 4 likes
  • 4 in conversation