/**********************************************************************/


%macro monthly(inputpds=)


/**********************************************************************/
 

filename in "&inputpds";


/**********************************************************************/


filename memlist '&templist';


/**********************************************************************/


proc source indd=in dirdd=memlist nodata noprint;
run;                                             


/**********************************************************************/


data _null_;                   
   infile memlist end=finaljob;
   input member $8.;           


/**********************************************************************/


if finaljob then                       
   call symput('nmbrjobs',put(_n_,5.));


/**********************************************************************/


   call symput('job'||left(put(_n_,5.)),trim(member));
run;                                                  


/**********************************************************************/


%do i=1 %to &nmbrjobs;                     
  %tso submit %str(%'&inputpds(&&job&i)%');
%end;                                      


/**********************************************************************/


%mend monthly;


/**********************************************************************/


%macro monthly(inputpds=);                               
   filename in "&inputpds";                              
   filename memlist '&templist';                         
   proc source indd=in dirdd=memlist nodata noprint;     
   run;                                                  
   data _null_;                                          
      infile memlist end=finaljob;                       
      input member $8.;                                  
      if finaljob then                                   
         call symput('nmbrjobs',put(_n_,5.));            
      call symput('job'||left(put(_n_,5.)),trim(member));
   run;                                                  
   %do i=1 %to &nmbrjobs;                                
     %tso submit %str(%'&inputpds(&&job&i)%');           
   %end;                                                 
%mend monthly;                         
                                       
%monthly(inputpds=deptpds.monthly.jobs)


/**********************************************************************/