Strive、 发表于 2017-11-12 12:38 
call symput没错,但我的需求是在
同一data步内把call symput定义的宏变量的值取出来。 请看看我的示例程序。我需要某2个函数或技巧,其中
fun1是将字符串赋值给数据集的变量,
fun2是将变量的值变成SAS文本。这才是我的需求。谢谢!
下面程序期望:1. 变量X的值是字符串var1=var2,2. fun2(X)的值是SAS文本var1=var2
%let checkList=var1 var2;
data _temp1;
set lib.raw;
length X $10.;
do i=1 to 2;
X=X||'='||fun1("&checkList",i);
if fun2(X)=1 then ....;
end;
run;