Guys, I want to achieve below goal, but I don't know how to convert string to SAS text, could someone help me please? Thanks in advance. for string, I mean, in data step, X="AAA" then X's value AAA is string. for SAS text, I mean, %let X=AAA, then AAA here is SAS text. purpose: for vars X1-XN, step1 exclude missing value, step2 check if X1=X2=...=XN is true for false (in below case, check X1=X2=X4) must be done in one data step; data in; X1=1; X2=1; X3=.; X4=1; run; %macro diff(vars=X1 X2 X3 X4); %let vars=%sysfunc(compbl(&vars)); %let count=%sysfunc(countw(&vars,' ')); data out; set in; length _CONN $100.; _CONN=''; %do i=1 %to &count; if missing(%scan(&vars,&i))=0 then _CONN=catx('=',_CONN,"%scan(&vars,&i)"); %end; call symputx('conn'||compress(_N_),_CONN); /*my problem is here, how to convert 【_CONN】 from string to SAS text?*/ /*symget('conn'||compress(_N_)) is string, not SAS text*/ if (symget('conn'||compress(_N_))) then JUDGE=1; else JUDGE=0; run; %mend; %diff;
... View more