【发布时间】:2019-11-20 14:15:51
【问题描述】:
我想将以下日期字符串 export v_date="20180101" 转换为 SAS 中的日期时间:
/* test.sas */
%let v_date = %sysget(v_date);
%put &=v_date;
data _null_;
format v_dt yymmddn8.;
v_dt = input(&v_date.);
call symput('v_dt', v_dt);
run;
%put &=v_dt;
使用export v_date="20180101"; /sas/scripts/sas test.sas运行
但我收到此错误:
1 %let v_date = %sysget(v_date);
2 %put &=v_date;
V_DATE=20180101
3
4 data _null_;
5 format v_dt yymmddn8.;
6 v_dt = input(&v_date.);
_
388
76
ERROR 388-185: Expecting an arithmetic operator.
ERROR 76-322: Syntax error, statement will be ignored.
7 call symput('v_dt', v_dt);
8 run;
如何读取此环境变量并将其转换为日期时间宏变量?
【问题讨论】:
标签: sas