Hi All, I have enrollment dataset of 10 subjects. Upon matched subjects from enrollment subjects rest of the forms (demog, conmeds,hxsys) subjects are extracted with its data. example , demog extracted has 10 subjects, conmeds extracted for 23 subjects(same 10 subjects with different data ) and hxsys has 12 subjects.Now my requirement is, for those 10 subjects of enrollment need to execute 3 at a time and generate log for those 3 and sleep for 1 minute , for next iteration 4 to 6 and sleep for 1 minute and so on.the task here is, for subject '123' we have multiple information in conmeds and hxsys. So considering this , if subject '123' comes in 1st iteration all the irecords for '123' should be executed. Here I have a major parts of my code. /***creating enrollment dataset****//// data test.enrlment_1; set enrlment_1; run; data _NULL_; if 0 then set enrlment_1 nobs=n; call symputx('nrows',n); stop; run; %put nobs=&nrows; /**all forms dumpped in final dataset, creating macro ***//// data _null_; set final_1 end=eof; call symput('pt'||compress(put(_n_,best.)),trim(left(upcase(subject)))); if eof then call symput('npts',compress(put(_n_,best.))); run; ****creating macro variable to create or run the report conditionally******; %let count=0; data _null_ ; set final_1 end=eof NOBS=COUNT;; countc = put(count,best.); if _n_ = 1 then call symput('count',countc); run; %put &count; /***After sepating each form from enrollment, looper macro created for ods. In Read macro looper macro is called****///// %macro read; %do j=1 %to &nrows; %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; %do i=1 %to &npts; %looper(subject=&&pt&j.); %end; %end; %mend caller(); %caller(); %mend read; %read;
... View more