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!
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!
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.