Hi All, I created a macro that create global variables based based on the program name I pass. when I execute macro it is not stop running. When I manually stop I am getting following error. What is wrong with my code? The input dataset has the value "l_demo_fas". Please help!!! 129 %datapgm(pgm=l_demo_fas); ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition. ERROR: The %TO value of the %DO I loop is invalid. ERROR: The macro DATAPGM will stop executing. *****Here is my code**** %macro datapgm(pgm=); %global nbt nbf outname pgmpath; data _NULL_; set adam.toc_prog; where pgm_id = "&pgm"; call symput('nbt',compress(input(strip(put(numtitle,3.)),$3.))); call symput('nbf',compress(input(strip(put(numfoot,3.)),$3.))); call symput('outname', compress(strip(outname))); call symput('pgmpath',compress(strip(pgmpath))); %do i = 1 %to &nbt; %global t&i; call symput('t'||"&i",strip(title_&i)); %end; %do j = 1 %to &nbf; %global f&j; call symput('f'||"&j",strip(foot_&j)); %end; run; %mend; %datapgm(pgm=l_demo_fas); %put &nbt. &nbf; %put &t1 &t2 &t3; %put &f1; %put &outname; %put &pgmpath; Thanks in advance!!!
... View more