Hi all,
I am trying to compress unwanted characters from a variable to remain with digits only. The dataset has about 1.8 million records and everytime I run the code EG crashes. I have tried restricting the OBS to say 1000 and that works fine. How can I avoid EG crashing when I run the code on the whole dataset. Code example below:
data test_003
(keep =
variable_1
variable_2
variable_3
variable_4);
set work.test_oo1;
variable_4_new=compress(variable_4,'','kd');
run;
So I am trying to compress variable_4 and have digits only remaining without out crashing my session.
It sounds like some sort of memory leak or disk space issue although 1.8M obs isn't that huge.
Try increasing the amount of available memory with the Memsize option http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0srij4mcdpzv2n1vt... although note that this has to be done at invocation of the session or in the config file.
It sounds like some sort of memory leak or disk space issue although 1.8M obs isn't that huge.
Try increasing the amount of available memory with the Memsize option http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0srij4mcdpzv2n1vt... although note that this has to be done at invocation of the session or in the config file.
How many variables are in work.test_oo1? Moving the keep-Option to the set-statement could help.
Absolutely right, move keep= to the SET statement. The way the program is written now, why bother to create the new variable? It wouldn't even become part of the new data set?
If this program really crashes EG, you might just need to clean out the WORK area (or more simply, just close down EG and start up a new session). From the names of your data sets, it's possible you have run so many tests that you are filling up the WORK area with data sets that you no longer need.
variable_4_new=compress(variable_4, ,'kd');
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.