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

If I run a code like one below, SAS (9.04.01M5P091317) seems to be taking up more and more memory with every loop without ever clearing it and eventually runs out of it. It only happens with the median function. The total memory usage is almost constant when I use 'mean' or 'distinct' instead. What's going on? 

 

%macro loop(n);
	%do i = 1 %to &n.;
		proc sql; 
			create table out as select 
			median(AgeCHDdiag)
			from sashelp.heart;
		quit;
	%end;
%mend;
%loop(1000);

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

This looks like a bug to me.

You can check the available memory with option XMRLMEM.

Report the issue to SAS Tech support.

View solution in original post

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

This looks like a bug to me.

You can check the available memory with option XMRLMEM.

Report the issue to SAS Tech support.

Tom
Super User Tom
Super User

Report it to SAS. http://support.sas.com 

Use PROC MEANS (aka PROC SUMMARY) or PROC UNIVARIATE instead of calculate medians.

Patrick
Opal | Level 21

@ods_trace_on 

I'm on the same SAS version 9.04.01M5P091317 under RHEL and can confirm your observation. 

Please raise this with SAS Tech Support.

andreas_lds
Jade | Level 19

Problem confirmed using the same version on windows server 2012r2.

Memory stays used after proc sql ends.

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
  • 1125 views
  • 0 likes
  • 5 in conversation