Hello,
I need to aumotatize a process and for this I need to use the date of the system to filter information.
DATA dates;
INPUT name $ 1-4 @6 bday date11.;
CARDS;
John 1 Jan 2019
Mary 11 Jul 2019
Kate 12 Nov 2019
Mark 8 Jun 2019
;
RUN;
PROC PRINT DATA=dates;
FORMAT bday date9. ;
RUN;I catch the date of the system using the function INTNX and I could use the date like a parameter.
%let day= %sysfunc(intnx( MONTH , %sysfunc( today() ) , 2), date9.);
%put &day;But, when I will compare, I can't have a good result
DATA dates;
set dates;
where bday > &day;
run;The mensseges are:
ERROR: Syntax error while parsing WHERE clause.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, AND, EQ, GE, GT, LE, LT,
NE, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
hello,
Is &M1. the same macrovariable as &day. ?
Try
where bday >"&M1."d;
Do you have to use macros ? can't you just write
where bday > intnx("month", today(),2);
hello,
Is &M1. the same macrovariable as &day. ?
Try
where bday >"&M1."d;
Do you have to use macros ? can't you just write
where bday > intnx("month", today(),2);
Yes, &M1. is the same macrovariable as &day.
I used yours sugestion and work! Tks for support me! ![]()
With
options mprint;
active, you would see what the macro pre-processor generated. Most-likely not a sas-date.
From what you have posted i can't tell anything more. Posting complete log is recommended.
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 save with the early bird rate—just $795!
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.