我使用此论坛收集有关在 SAS EG 任务和查询中创建和使用提示的信息。但是,我似乎无法从 Base SAS 转移我自己的语法、合并/引用提示/我创建的宏,并让它工作。
目前,每次我在自己的程序中引用提示(而不是通过 SAS EG 中的点击选择生成的提示)时,日志都会告诉我 SAS 无法解析宏引用。
如何将自己的程序转移到 SAS EG 中,然后集成提示?
我用来开发测试数据集的示例代码:
data work.testscores;
input Gender $ 1-6 SATScore 8-11 IDNumber 13-20;
datalines;
Male 1170 61469897
Female 1090 33081197
Male 1240 68137597
Female 1490 9589297
Male 1200 93891897
Female 1080 26212897
Male 1050 8945097
Female 1200 51799397
Male 1600 39196697
;
run;
/使用性别变量在提示管理器中创建性别提示/
PROC SQL;
CREATE table WORK.testscores2 as
SELECT &Genders, SATScore
FROM WORK.TESTSCORES
;
QUIT;
日志:
102 PROC SQL;
103 CREATE TABLE WORK.TESTSCORES2 AS
104 SELECT &Genders
WARNING: Apparent symbolic reference GENDERS not resolved.
104 SELECT &Genders
_
22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
a numeric constant, a datetime constant, a missing value, BTRIM, INPUT, PUT,
SUBSTRING, USER.
105 FROM WORK.TESTSCORES;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
106 QUIT;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
谢谢