我正在尝试在企业指南中运行一个提示输入日期的程序。我已经配置了提示,它在我运行程序时出现。在程序日志的顶部,我得到以下行,这些行似乎显示提示的宏值正在正确填充:
7 %LET Processing_Month_end = 30Nov2015;
8 %LET Processing_Month = 01Nov2015;
9 %LET Processing_Month_label = November 2015;
我的问题是如何在我的程序稍后使用这些宏值作为日期。如果我尝试一个简单的数据步骤:
data dates;
refDate = &Processing_Month;
run;
我收到以下错误:
24 GOPTIONS ACCESSIBLE;
25 data dates;
26 refDate = &Processing_Month;
NOTE: Line generated by the macro variable "PROCESSING_MONTH".
26 01Nov2015
_______
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN,
LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.
27 run;
如果我尝试使用输入将值格式化为日期:
data dates;
refDate = input(&Processing_Month, date9.);
run;
我收到类似的错误:
24 GOPTIONS ACCESSIBLE;
25 data dates;
26 refDate = input(&Processing_Month, date9.);
NOTE: Line generated by the macro variable "PROCESSING_MONTH".
26 01Nov2015
_______
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN,
LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.
27 run;
如果我尝试将宏值包装在日期文字中:
data dates;
refDate = '&Processing_Month'd;
run;
错误:
24 GOPTIONS ACCESSIBLE;
25 data dates;
26 refDate = '&Processing_Month'd;
____________________
77
ERROR: Invalid date/time/datetime constant '&Processing_Month'd.
ERROR 77-185: Invalid number conversion on '&Processing_Month'd.
27 run;
我需要对这个提示宏变量使用什么语法或函数才能将其用作 sas 日期?