Hi

I often deal with very large datasets and save a lot of space when compressing. Sometimes I have the same do files that sometimes need to handle a new dataset (because I updated it, or added some new columns) and therefore need to compress it again. I then -save, replace- the dataset, so that I then have a compressed data set.

I often manually compress and save when I have a new dataset, but I would like to automate it. If I understood correctly the compress check if often quite quick, but the save command may often take a lot of time. Is there a way to only have STATA save the data set if it was compressed? Something like:

Code:
compress
if compress==True:
   save, replace