BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
My turn to ask something.

Can SAS read a gzipped file directly?
I mean with an infile - input statement pair, not through the set command.

We have a number of text files that are zipped up that we need to be able to read.
The files used to go to a Unix server where cron'd shell scripts controlled the files being uncompressed and compressed, to expose the most recent two days.
Now, the files are being stored on a Windows server, controlled by different people and processes. So, it would be best for us to use SAS to grab the file directly, and read it from the compressed/gzipped form.

Humans are able to read the files directly through WinZIP, which acts as a intermediary between the zipped file and notepad or wordpad.

I'd ask tech support, but I'd rather not wait a week for someone to get back to me.
1 ACCEPTED SOLUTION

Accepted Solutions
paulkaefer
Lapis Lazuli | Level 10

I see this is an old thread, but it appeared early in my search results. So I just wanted to share a 2017 blog post, Reading and writing GZIP files with SAS by @ChrisHemedinger that answers the question.

 

...and I want to respond to the jab at tech support taking a week: whenever I've submitted a track with SAS Tech Support, they've replied within 24 hours (not including weekends and holidays), as stated in their automated ticket email. I've been very happy with how responsive they've been, even if there's a little back-and-forth needed.

View solution in original post

3 REPLIES 3
deleted_user
Not applicable
read through a filename pipe.
See the sample I found among Support.sas.com, knowledge base, Samples and Notes
http://support.sas.com/kb/25/206.html
entitled
25206 - SAMPLE: Create/Read a Unix compressed file from SAS
deleted_user
Not applicable
Ahh, piping.
Never used it before.
Now we have a reason to.
Thanks Pete.

I was hoping that SAS/ACCESS for PC files would allow
[pre]
FILENAME my_gzip ZIP ".... .gz";
[/pre]
so that we could then do something like
[pre]
infile my_gzip(zipped_file);
[/pre]

But no.
Oh well.

Dreaming ...
paulkaefer
Lapis Lazuli | Level 10

I see this is an old thread, but it appeared early in my search results. So I just wanted to share a 2017 blog post, Reading and writing GZIP files with SAS by @ChrisHemedinger that answers the question.

 

...and I want to respond to the jab at tech support taking a week: whenever I've submitted a track with SAS Tech Support, they've replied within 24 hours (not including weekends and holidays), as stated in their automated ticket email. I've been very happy with how responsive they've been, even if there's a little back-and-forth needed.

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 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
  • 3 replies
  • 6800 views
  • 1 like
  • 2 in conversation