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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1467 views
  • 4 likes
  • 4 in conversation