BookmarkSubscribeRSS Feed
Bruno7
Obsidian | Level 7

How do I unzip a PASSWORD PROTECTED .gz file using SAS code?

I know there is a way to unzip .gz files with SAS code, but is there a way to also open password protected .gz files using SAS code?

 

Example:

x gunzip --stdout "/mydir/test_gz_password_protected.sas7bdat.gz" > "/mydir/test_gz_no_password.sas7bdat";

 

How do I modify this to incorporate the password?

1 REPLY 1
ChrisHemedinger
Community Manager

From what I've read gzip does not support password encryption. The techniques people use involve another tool to encrypt the content and then pipe it to gzip.

 

If that's the case, then expanding it to an unencrypted version would involve the reverse process. Unzip the gz, and pipe the content to the tool to decrypt. Without knowing how the original was encrypted we cannot offer a specific command syntax.

 

The FILENAME ZIP / GZIP method can't be used for this, at least not on its own.

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.

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
  • 1 reply
  • 1654 views
  • 0 likes
  • 2 in conversation