BookmarkSubscribeRSS Feed
lillymaginta
Lapis Lazuli | Level 10

I have a sas file that is in file.tsv.gz, any ideas how to open this file in SAS? 

Thank you,

5 REPLIES 5
Tom
Super User Tom
Super User

What is in the file?

Why not run a little SAS program to look at the beginning of the file.

data _null_;
  infile 'file.tsv.gz' zip gzip obs=10;
  input;
  list;
run;
lillymaginta
Lapis Lazuli | Level 10

Thank you for the prompt response. The file contain a very large data. I don't think the file is zipped but I might be wrong. Running the statement you provided resulted in the following error " ERROR 23-2: Invalid option name GZIP"

Reeza
Super User
What version of SAS do you have, the exact version. GZ does mean zipped, via GZIP, later versions of SAS support this format and you can read the text file directly from the zipped file. But I think it's literally the latest version, SAS 9.4M6. If you have an older version you need to uncompress the file to read it first.
Tom
Super User Tom
Super User

You will need to use a more recent version of SAS to have the GZIP option.

You will need to unzip the file outside of SAS then.  Use gunzip (or gzip -d option). Or some other tool that knows how to expand GZIP format.

 

If you can run operating system commands from within SAS you can do it on the fly if you want with the PIPE filename engine.

Is it easy on unix.

infile 'gzip -cd file.tsv.gz' pipe obs=10;

 

Patrick
Opal | Level 21

If you use "tsv.gz" as search term right here then you'll find a few discussions which might help you to proceed.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 1312 views
  • 4 likes
  • 4 in conversation