Hello.
I am having trouble trying to figure out why an error is generating when I am calling a macro that I created. Here is what I am doing:
proc sql;
select max(export_created_date_time) format=datetime21.2
into :current_date_file_created
from msrflow.msrflow_dlytemp
;
quit; %put ¤t_date_file_created;
Log file generates the datetime value of the macro
24 25 %put ¤t_date_file_created; 03AUG2020:15:38:26.00 26
I am calling that macro in a simple query
proc sql;
create table data as
select
¤t_date_file_created as date_file_created format=datetime21.2
from table1
;
quit;
I get the following syntax error:
NOTE: Line generated by the macro variable "CURRENT_DATE_FILE_CREATED".
106 03AUG2020:15:38:26.00
_______
22
76
3 The SAS System 09:28 Tuesday, August 4, 2020
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?,
AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH,
LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
Any tips on what I am doing wrong?
... View more