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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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