/* Method 3: Macro with CALL SYMPUT Routines          */

  /* Step 1: Read parameter file, declare FILENUM, store the total */
  /* number of observations, and create a macro call for each */
  /* observation                                             */
data _null_;
   set pfile end=last;
   if last then call symput('filenum',left(_n_));
   call symput ('file' || left(_n_),
     '%process('||strand||','||grade||','||form||','||
    mnum||','||onum||','||mstart||','||ostart||')' );

________________________________________________________________________

%let file1=%process(m,4,11,19,3,9,29);
%let file2=%process(m,4,12,18,5,12,31);
more SAS statements
%let file19=%process(m,6,20,18,3,12,31);

   /* Step 2: write a macro that processes the data files */
%macro process(strand,grade,form,mnum,onum,mstart,ostart);
   data raw;
      infile dd(&strand.&grade.&form);
      input @&mstart (m1-m&mnum) ($1.)
           @&ostart (o1-o&onum) (1.);

   proc freq;
      tables m1-m&mnum o1-o&onum;
%mend;

   /* Step 3: Invoke macro PROCESS in a loop */
%macro invoke;
    %do i=1 %to &filenum;
       &&file&i
    %end;
%mend;
%invoke