DATA Step, Macro, Functions and more

Reading gzip files

Reply
N/A
Posts: 0

Reading gzip files

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.
N/A
Posts: 0

Re: Reading gzip files

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: Reading gzip files

Posted in reply to deleted_user
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 ...
Ask a Question
Discussion stats
  • 2 replies
  • 2459 views
  • 0 likes
  • 1 in conversation