Hey Tom, I revised your solution to fit my needs as seen below. It seems to create the output, but I still get an error message. Any guidance would be appreciated. Note the "+(date)" line in the log on line 100. Confused as to why that is populating. %macro help(date);
data test;
set &date.;
%do i=1 %to 78;
call symputx('typ',vtype(var&i.));
%if N=&typ %then %do;
new_var&i.=put(var&i.,$100.);
%end;
%else %do;
new_var&i.=var&i.;
%end;
%end;
run;
%mend;
%help(data_20200727); Log: 1 %studio_hide_wrapper; 82 %macro help(date); 83 data test; 84 set &date.; 85 86 %do i=1 %to 78; 87 88 call symputx('typ',vtype(var&i.)); 89 90 %if N=&typ %then %do; 91 new_var&i.=put(var&i.,$100.); 92 %end; 93 %else %do; 94 new_var&i.=var&i.; 95 %end; 96 %end; 97 98 run; 99 %mend; 100 %help(data_20200727); 100 +(date); - 22 76 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_. ERROR 76-322: Syntax error, statement will be ignored. NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
... View more