Hello:
I would like to have create a system today format with YYYY_MM_DD. Something wrong with my code below, could someone help me to fix it? Thanks.
data Today;
input Today : $50.;
call symput('tdate',put(year("&sysdate"d),4.)||'_'||put(month("&sysdate"d),z2.)||'_'||put(day("&sysdate"d),z2.));
run;
Are you after this?
data _null_;
/*input Today : $50.;*/
call symput('tdate',put(year("&sysdate"d),4.)||'_'||put(month("&sysdate"d),z2.)||'_'||put(day("&sysdate"d),z2.));
run;
%put &tdate;
Are you after this?
data _null_;
/*input Today : $50.;*/
call symput('tdate',put(year("&sysdate"d),4.)||'_'||put(month("&sysdate"d),z2.)||'_'||put(day("&sysdate"d),z2.));
run;
%put &tdate;
@ybz12003 wrote:
Hello:
I would like to have create a system today format with YYYY_MM_DD. Something wrong with my code below, could someone help me to fix it? Thanks.
data Today;
input Today : $50.;
call symput('tdate',put(year("&sysdate"d),4.)||'_'||put(month("&sysdate"d),z2.)||'_'||put(day("&sysdate"d),z2.));
run;
What is "wrong"?
Your code shows an input statement with no source to read.
Which is why you get the error:
ERROR: No DATALINES or INFILE statement.
Did you read the log? That is a fairly clear error message.
I did see the error message, that's why I post Q.
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.