We zipped a dataset using:
- call system("gzip path/data.sas7bdat")
However, when we unzipped it using:
- call system("gzip -d path/data.sas7bdat")
We noticed that its size was different from before it was zipped. Does this mean that something changed in the data set? We compared it from its back up data set using proc compare though but there is no discrepancy. However, their file sizes are different. May we know the reason behind this?
@iSAS wrote:
We zipped a dataset using:
- call system("gzip path/data.sas7bdat")
However, when we unzipped it using:
- call system("gzip -d path/data.sas7bdat")
We noticed that its size was different from before it was zipped. Does this mean that something changed in the data set? We compared it from its back up data set using proc compare though but there is no discrepancy. However, their file sizes are different. May we know the reason behind this?
That wouldn't work. gzip creates
path/data.sas7bdat.gz
while
gzip -d path/data.sas7bdat
will find that the sas7bdat is not a gzipped file and would fail. Since the gzip removes the source file, there must be some process that recreated the sas7bdat. So I suggest you do a
mv path/data.sas7bdat path/data_new.sas7bdat gzip -d path/data.sas7bdat.gz
and then do a visual compare of the size and the timestamps of data_new.sas7bdat and data.sas7bdat, as gzip preserves those during the whole process.
I've never had a change of physical filesize from gzip / gzip -d.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.