@Ramya2 wrote:
If it is before looper, it will create log for each subject. I dont want the log to be created for each subject.
I think this is incorrect. There is nothing in the code that will cause a log for each subject to be generated.
With all suggested changes:
%macro caller();
%do j=1 %to &npts;
%if %sysfunc(mod(&j,3))=1 %then
%do;
proc printto new log ='"/ctshared/cdr/dev/RAMYA/archive/logfile_&j..log";
run;
%let rc=%sysfunc(sleep(60,1));
%end;
%looper(subject=&&pt&j.);
%end;
%mend caller();
Should be OK. Try it and see. Careful programming might eliminate an unnecessary SLEEP.
So that's closer. Now move the %LOOPER macro as @PaigeMiller suggested.
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.