Hello,
i have a macro variable in numeric. like &jour = 23040,
In CAS i try to find line where dateColumn > &jour bu i have the error :
ERROR: Operator is not unique: DATE > INTEGER
Can someone help me plz.
FedSQL is pretty strictly ANSI compliant. Expressions require date constants to be written in ANSI-standard format - DATE'YYYY-MM-D'. The raw SAS date number must be formatted properly and surrounded by single quotes. You can use PUTN to format the value, but the dashes will be misinterpreted as a minus sign if you use %SYSFUNC to execute the PUTN function, and macro code won't execute if surrounded by single quotes.
Example:
data jours;
input jour;
datalines;
23038
23039
23040
23041
23042
;
%let Aujourdhui=23040;
proc FedSQL;
select *
from jours
where jour>=date%tslit(%qsysfunc(putn(&Aujourdhui,yymmddd10.)));
;
quit;
Hope this helps.
FedSQL is pretty strictly ANSI compliant. Expressions require date constants to be written in ANSI-standard format - DATE'YYYY-MM-D'. The raw SAS date number must be formatted properly and surrounded by single quotes. You can use PUTN to format the value, but the dashes will be misinterpreted as a minus sign if you use %SYSFUNC to execute the PUTN function, and macro code won't execute if surrounded by single quotes.
Example:
data jours;
input jour;
datalines;
23038
23039
23040
23041
23042
;
%let Aujourdhui=23040;
proc FedSQL;
select *
from jours
where jour>=date%tslit(%qsysfunc(putn(&Aujourdhui,yymmddd10.)));
;
quit;
Hope this helps.
Hello. thks you so much. It helps and it works
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.