我需要创建提示。实际上我创建了另外两个没有问题,但是当我创建提示时,其中一个变量是不同的。我需要用以下方法做宏:
%macro param_list;
%global
list_selected
;
%let i=1;
%let p_lst_tmp = %scan(&VID,&i);
%do %while(&p_lst_tmp ne);
%let list_selected = &list_selected "%scan(&VID,&i)";
%let i = %eval(&i+1);
%let p_lst_tmp = %scan(&VID,&i);
%end;
%put list_selected = &list_selected;
%mend;
然后在我创建的代码中
PROC SQL;
CREATE TABLE Student_Pre AS
SELECT t1.personid LABEL="PIDM" AS PIDM,
t1.V_ID as VID,
t1.FIRST_NAME
FROM ENROLL.Student_Dim t1
WHERE t1.v_id = &list_selected
ORDER BY t1.personid;
QUIT;
但是这段代码给出了一个错误,ERROR 22-322:语法错误,期望以下之一:;,!,!!,&,(,,* ,+, - , '。',/,&lt ;,< =,<&gt ;, =,>,> =,AND,EQ,EQT,EXCEPT,GE,GET,GROUP,GT,GTT,HAVING,INTERSECT,LE ,LET, LT,LTT,NE,NET,NOT,OR,ORDER,OUTER,UNION,^,^ =,|,||,〜,〜=。
ERROR 76-322:语法错误,语句将被忽略。
我该如何更改代码?