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

Hi all,

 

As we know that sometimes the dataset is too big, so I have some zipped sas7bdat datasets (with .gz tail). I did a search to find a way to import the zip file thAT I can work with this sas7bdat file without losing too much space in the hard drive.

 

However, I found this link saying that I need to unzip the zip file. However, I also find another SAS document saying that we can import the dataset from ipped file.

Before digging further, I want to ask if I follow the later document, if I read the data from the zipped file directly, whether SAS also need to unzip this file and then cost the memory?

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

So first thing is that you have GZIP file, not a ZIP file.  A ZIP file is an archive that can contain multiple individual files.  A file that has been compressed with GZIP is just a single file.

 

You can use the ZIP filename engine to read a GZIP file, but you cannot at the same time try to access the uncompressed file as a SAS dataset.  So you will have to uncompress the file first before you can read the data out of it.  You can use your local operating system command to uncompress the file or you can use SAS code to first uncompress the file.

 

Is space is a major issue then it might work better to have a text file, like a CSV file.  Then you  could read the lines of text directly from the compressed version using the ZIP filename engine with the GZIP option.  But then you would need to have a program that knows what columns the text files has and how to read them as there is no place in a CSV file to store the metadata about the variables.

 

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

So first thing is that you have GZIP file, not a ZIP file.  A ZIP file is an archive that can contain multiple individual files.  A file that has been compressed with GZIP is just a single file.

 

You can use the ZIP filename engine to read a GZIP file, but you cannot at the same time try to access the uncompressed file as a SAS dataset.  So you will have to uncompress the file first before you can read the data out of it.  You can use your local operating system command to uncompress the file or you can use SAS code to first uncompress the file.

 

Is space is a major issue then it might work better to have a text file, like a CSV file.  Then you  could read the lines of text directly from the compressed version using the ZIP filename engine with the GZIP option.  But then you would need to have a program that knows what columns the text files has and how to read them as there is no place in a CSV file to store the metadata about the variables.

 

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
  • 2 replies
  • 1297 views
  • 2 likes
  • 3 in conversation