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!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
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.