Good Afternoon All,  I am running the below Macro code and getting some errors.     data _null_;  set hospcnt;  call symput('maxcnt',maxnum);  run;  %put &maxcnt;  /* loop to go through all hospitals */  %macro hosrep();  %do j= 1 %to &maxcnt;   data _null_;  set hospcnt;  if cnt=&j;  call symput('i',trim(left(prvorg)));  run;  data report1;  set &save..procrpt;  if prvorg="&i";   run;  %end;  %mend hosrep;     Error:  MPRINT(HOSP_LOOP):   data _null_;  MPRINT(HOSP_LOOP):   set hospcnt;  MPRINT(HOSP_LOOP):   call symput('maxcnt',maxnum);  MPRINT(HOSP_LOOP):   run;  NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).        3:179    NOTE: There were 91 observations read from the data set WORK.HOSPCNT.  NOTE: DATA statement used (Total process time):        real time           0.00 seconds        user cpu time       0.00 seconds        system cpu time     0.00 seconds        memory              189.17k        OS Memory           26480.00k        Timestamp           09/24/2015 12:37:28 PM         SYMBOLGEN:  Macro variable MAXCNT resolves to           91  91  SYMBOLGEN:  Macro variable MAXCNT resolves to           91  SYMBOLGEN:  Macro variable MAXCNT resolves to           91  NOTE: Line generated by the invoked macro "HOSREP".  1       data _null_;     set hospcnt;     if cnt=&j;     call symput('i',trim(left(prvorg)));    run;      data report1;                                                   -                                                   22  1    !      set &save..procrpt;     if prvorg="&i";        run;     data report2;     set &save..percents;     if  1    ! prvorg="&i";  MPRINT(HOSREP):   data _null_;  MPRINT(HOSREP):   set hospcnt;  WARNING: Apparent symbolic reference J not resolved.  MPRINT(HOSREP):   if cnt=&j;  MPRINT(HOSREP):   call symput('i',trim(left(prvorg)));  MPRINT(HOSREP):   run;  ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant,                a datetime constant, a missing value, bitstring, INPUT, PUT.   NOTE: The SAS System stopped processing this step because of errors.  NOTE: DATA statement used (Total process time):        real time           0.13 seconds        user cpu time       0.00 seconds        system cpu time     0.00 seconds        memory              125.64k        OS Memory           26480.00k        Timestamp           09/24/2015 12:37:28 PM         MPRINT(HOSREP):   data report1;  SYMBOLGEN:  Macro variable SAVE resolves to work  MPRINT(HOSREP):   set work.procrpt;  WARNING: Apparent symbolic reference I not resolved.  MPRINT(HOSREP):   if prvorg="&i";  MPRINT(HOSREP):   run; 
						
					
					... View more