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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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