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 more
This usually happens when SAS ran out of disk space while creating the dataset. Rerun the process which created the dataset in the first place.
... View more
Seems trival as long as the datasets are sorted by CODES.
data event21 ;
input Codes $ Event21 $;
cards;
A CDC
F JFK
G BOB
;
data event22 ;
input Codes $ Event22 $;
cards;
A EED
F UOP
G SNP-D
;
data event23 ;
input Codes $ Event23 $;
cards;
A EED
F UOP
G SNP-D
K BDP
;
data members ;
input MemberID DOB :mmddyy. Codes $;
format dob yymmdd10.;
cards;
123 1/30/2021 F
456 2/28/2022 G
789 3/30/2023 K
;
data want;
merge members(in=in1) event21-event23;
by codes ;
array events [2021:2023] event21-event23;
if in1;
if year(dob) in (2021:2023) then event = events[year(dob)];
drop event21-event23 ;
run;
... View more
Make it a habit to use only fully qualified path names in OS commands, especially when writing shell scripts.
This makes the commandline resilient against any changes in current working directory, and you will often need to redirect stuff like log files because the script won't have write permission on the CWD, and you don't want to clutter up your program directory with logs.
... View more