BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
f_shoko
Calcite | Level 5

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisBrooks
Ammonite | Level 13

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.

View solution in original post

4 REPLIES 4
ChrisBrooks
Ammonite | Level 13

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.

andreas_lds
Jade | Level 19

How many variables are in work.test_oo1? Moving the keep-Option to the set-statement could help. 

Astounding
PROC Star

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.

Ksharp
Super User
variable_4_new=compress(variable_4, ,'kd');

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 689 views
  • 1 like
  • 5 in conversation