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);
This looks like a bug to me.
You can check the available memory with option XMRLMEM.
Report the issue to SAS Tech support.
This looks like a bug to me.
You can check the available memory with option XMRLMEM.
Report the issue to SAS Tech support.
Report it to SAS. http://support.sas.com
Use PROC MEANS (aka PROC SUMMARY) or PROC UNIVARIATE instead of calculate medians.
I'm on the same SAS version 9.04.01M5P091317 under RHEL and can confirm your observation.
Please raise this with SAS Tech Support.
Problem confirmed using the same version on windows server 2012r2.
Memory stays used after proc sql ends.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.