Date: Thu, 31 May 2012 19:16:34 -0400
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject: Re: Datastep memory leak?
Why are including () in the definition of a macro with no parameters?
Perhaps SAS is confused by this and is pushing something on the stack that
it never pops off?
Also try calling it with a trailing semi-colon rather than the empty
parameter list. Perhaps the SAS parser is getting confused by the hanging
statement with no termination character?
Is it possible that the datalines are confusing SAS? How about if you
instead run that step as an independent job to save permanent SAS datasets
and just reference the datasets. Again most likely not the issue, but you
can easily eliminate it to help your debugging.
I also do not like the pointing of a libname to the same directory as WORK,
but do not see that it should cause any issue with your simplified example.
Unless your are running some type of system clean-up job that is deleting
the WORK directory out from under your SAS process. But I doubt that would
cause a memory leak.
On Thu, 31 May 2012 14:56:48 -0700, Sterling Paramore <gnilrets@GMAIL.COM>
wrote:
>Dear SAS-L,
>
>I've got a job that that loops through and modifies a small table
>10,000's of times over the course of a few days, at which point the
>system (AIX server) runs out of memory. I've whittled down the code
>to something very simple but still reproduces the problem. Can anyone
>help me understand why the following would cause such problems?
>
>Last time I ran this it seemed to be eating up memory at about 1-
2MB/second.
>
>
>%put PID = &SYSJOBID;
>
>
>libname SDIMETL "%sysfunc(pathname(WORK))";
>
>
>* Initialize job status;
>data SDIMETL.jsched_job_sts;
>
> length
> job_name $64
> job_queue $32
> job_schedule $32
> priority 8
> nthreads 8
> job_sas $1024
> job_sts_cd 8
> job_sts $32
> dep_satisfy 8
> job_err_cd 8
> job_err_msg $80
> job_start 8
> job_end 8
> job_elapsed_time 8
> job_thread $8
> job_pid 8
> job_log $256
> ;
> format
> job_start DATETIME22.0
> job_end DATETIME22.0
> job_elapsed_time TIME8.
> ;
>
> input job_name job_queue job_schedule priority nthreads job_sas;
> infile datalines4 dsd dlm='|';
>
>
> if job_schedule = "manual" then
> job_sts_cd = 3;
> else
> job_sts_cd = 0;
> dep_satisfy = 0;
> job_err_cd = 0;
> job_start = .;
> job_end = .;
> job_elapsed_time = .;
>
> datalines4;
>good_to_go|main|manual|10|1|%put good_to_go;
><plus another 300 similar lines>
>;;;;
>
>run;
>
>
>* Job dependencies;
>data SDIMETL.jsched_job_dep;
> length
> job_name $64
> dep_name $64
> dep_type $10;
>
> input job_name dep_name dep_type;
> infile datalines4 dsd dlm='|';
> datalines4;
>init_etl|good_to_go|job
>init_set_load_date|init_etl|job
><plus another 700 similar lines>
>;;;;
>run;
>
>
>
>
>
>%macro jsched_find_next(
> );
>
>
> data _NULL_;
> set SDIMETL.jsched_job_sts
> SDIMETL.jsched_job_dep;
> run;
>
>
>%mend jsched_find_next;
>
>
>*options mprint notes;
>options nomprint nonotes;
>
>%macro wrap;
> %do i = 1 %to 10000000;
> %if %sysfunc(mod(&i,100))=0 %then
> %put i = &i %sysfunc(datetime(),DATETIME22.3);;
> %jsched_find_next()
> %end;
>%mend wrap;
>%wrap;