BookmarkSubscribeRSS Feed
chandler
Fluorite | Level 6

We use a server with operating system Windows Server 2008 Standard, 64 bit.  SAS for Windows is loaded as release 9.2,  64 bit version.

Our Information Technology department is not well versed on SAS and the needs of the SAS System.  There is a monitoring system in place and it keeps giving us these warnings:  "Spectrum ALARM - Physical Memory Usage Too High".   Has anybody ever dealt with this issue ?

Some have suggested that the problem may be a few programmers, new to SAS,  running code that is not efficient, thus, using up a lot of physical memory.   My question is What tips can I give to the new guys about how to write more efficient code, without sending them off to a SAS training course?

2 REPLIES 2
Astounding
PROC Star

There are a number of places that new users can use a lot of memory.  This is only a guess at what might apply in your shop.

In a DATA step, new users have to realize that these steps are different:

data new (keep=a list of final variables);

set old;

** calculations;

run;

data new (keep=a list of final variables);

set old (keep=just the variables I need to read in);

** calculations;

run;

The first step reads in all of the variables.  If you have a gazillion variables, that can consume memory.

In PROC FREQ, the software tracks all combinations.  So this table would require enormous amounts of memory:

proc freq data=purchases;

   tables credit_card_no * date / noprint out=counts;

run;

In PROC MEANS (or PROC SUMMARY), the CLASS statement tracks all levels at once.  That can also consume memory:

proc summary data=purchases;

   class credit_card_no;

   var amount;

   output ...

run;

But there's no guarantee that the fault lies with the users.  And here at the discussion forum, we don't really have much of a clue as to what the users are actually doing.  These are just some pitfalls using commonplace tools.

Good luck.

FriedEgg
SAS Employee

You can setup restrictions to memory consumption by using SAS system options.

Inspect you current setup by running the following:

proc options group=memory; run;

you can limit the memory SAS will use by altering these options

Here are links to additional information about the memory options:

System administration: MemorySORTSIZE= System OptionSpecifies the amount of memory that is available to the SORT procedure.

SUMSIZE= System OptionSpecifies a limit on the amount of memory that is available for data summarization procedures when class variables are active.

MEMSIZE System Option under Windows, UNIX, OpenVMS, z/OS

REALMEMSIZE System Option under Windows, UNIX, OpenVMS, z/OS

MEMMAXSZ System Option: Windows

MEMLIB System Option: Windows

MEMCACHE System Option: Windows

LOADMEMSIZE System Option: Windows

MEMBLKSZ System Option: Windows

Be careful when setting the options as you can cause errors to occur by setting options too low and you can also dramatically increase disk operations and decrease performance.

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
  • 2 replies
  • 1109 views
  • 0 likes
  • 3 in conversation