BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
qc1
Fluorite | Level 6 qc1
Fluorite | Level 6
My code is:
options compressed=yes;
libname public "path/to/public";
x "gunzip path/to/public/sale_21.sas7bdat.gz";

proc append base=public.sale_21 data=public.new_21 force;
run;

x "gzip path/to/public/sale_21.sas7bdat";


At the beginning, there are two datasets under public folder: one compressed sale_21.sas7dbat.gz and one uncompressed new_21.sas7bdat

I want to uncompressed sale_21 add data from new_21 to the end of sale_21, and then gzip it back. The public folder should still have two datasets.

But after I run my program, it create another dataset, now my public folder has three files : one compressed sale_21.sas7bdat.gz and one uncompressed sale_21.sas7bdat and the original new_21.sasbdat. Why it created additional datasets? What should the codes be ??

Thanks SO much!! Any help would be greatly appreciated!
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Are you asking how the commands gzip and gunzip work?

Shouldn't that be asked somewhere else?

 

If you want to see what messages the operating system is generating when you run those commands I recommend NOT using the X command.  Instead use a PIPE so your can read the responses and at least write them to the SAS log.

data _null_;
  infile
   "gunzip path/to/public/sale_21.sas7bdat.gz &2>1"
    pipe
  ;
  input;
  put _infile_;
run;

If that does not work then just try opening a terminal window to the SAS server and running the commands directly in the terminal window and observe the behavior.  Perhaps your system has defined an alias for gzip that causes it to not replace the existing file but leave it behind.

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

Are you asking how the commands gzip and gunzip work?

Shouldn't that be asked somewhere else?

 

If you want to see what messages the operating system is generating when you run those commands I recommend NOT using the X command.  Instead use a PIPE so your can read the responses and at least write them to the SAS log.

data _null_;
  infile
   "gunzip path/to/public/sale_21.sas7bdat.gz &2>1"
    pipe
  ;
  input;
  put _infile_;
run;

If that does not work then just try opening a terminal window to the SAS server and running the commands directly in the terminal window and observe the behavior.  Perhaps your system has defined an alias for gzip that causes it to not replace the existing file but leave it behind.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 997 views
  • 0 likes
  • 2 in conversation