Hello,
Could someone help me with converting a date to yyyymm (numeric)? Here's how I would like to use my code:
%let xdate = '01NOV2018'd;%let yymm = <code here to return 201811 as numeric>;
proc sql;select *from xxwhere timeframe = &yymm;quit;
Thanks.
Hi @jffeudo86
%let xdate = '01NOV2018'd; %let yymm = %sysfunc(putn(%sysevalf(&xdate),yymmn6.)); %put &=yymm;
I will not ask "why" 🙂
View solution in original post
Please don't ask why do I have to use xdate and go straight to 201811.
You're always welcome. Have a nice day! Cheers!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.