I am not sure why I am getting this error.
data have;
input start_date :date11.;
a=' 23:59:59 ';
b=put(start_date, yymmddd10.);
result=cat(b,a);
put result $char.;
datalines;
31MAY2020
;
run;
data _null_;
valueStmt=cats('write values "RequestTime" "',&result,'";');
put valueStmt;
run;22
23 GOPTIONS ACCESSIBLE;
24 data have;
25 input start_date :date11.;
26
27 a=' 23:59:59 ';
28 b=put(start_date, yymmddd10.);
29 result=cat(b,a);
30 put result $char.;
31
32 datalines;
2020-05-31 23:59:59
NOTE: The data set WORK.HAVE has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
34 ;
35 run;
36
37 data _null_;
38 set have;
39 valueStmt=cats('write values "RequestTime" "',&result,'";');
_
22
WARNING: Apparent symbolic reference RESULT not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, INPUT, PUT.
40 put valueStmt;
41 run;
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
39:48
2 The SAS System 08:31 Tuesday, July 21, 2020
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Macro variable &result has never been assigned a value. So the SAS code doesn't know what to do when it sees &result.
Macro variable &result has never been assigned a value. So the SAS code doesn't know what to do when it sees &result.
I added this line code on the top and worked. Thank you very much!
%let result2=put(%UNQUOTE(%STR(%'&result1%')),20.);
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.