- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I did see the error message, that's why I post Q.