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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.