I added &systime to my footnote so that I can see when it runs. I am confused that the footnote showed the executed time was four hours ahead.
Would anybody explain it to me why it is so? For example, it is 9am, how can I adjust this so that it shows the right time that I run the sas code.
Thanks.
I don't know what you did so not really. Footnotes/Titles don't stand on their own, you run them with a proc, so showing me a single line of code doesn't mean much.
You can try the SAS magic string to reset, usually this means you forgot a run or semi colon.
Does your header say a certain proc is running? You may just need to reboot the application.
;*';*";*/;
For footnotes either of these will work, if you use them correctly.
ods html;
proc print data=sashelp.class;
footnote1 "Created on %sysfunc(datetime(), datetime21.) ";
run;
proc print data=sashelp.air(obs=10);
footnote1 "Created on %sysfunc(date(), date9.) %sysfunc(time(), time8.) ";
run;
ods html close;
Use TIME()
%put %sysfunc(time(), time8.);
systime contains the time SAS was started, so perhaps yesterday at whatever time is noted?
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543691.htm
footnote1 "Created on &sysdate9 %put %sysfunc(time(), time8. )";
I need to put time to my footnote. So I added your code to my footnote statement, it does not work
Remove the %put
"
--------------
49
4238! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS
release. Inserting white space between a quoted string and the succeeding
identifier is recommended.
@Bal23 wrote:
"
--------------
49
4238! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS
release. Inserting white space between a quoted string and the succeeding
identifier is recommended.
1. It's a note, not an error.
2. It tells you exactly how to fix it.
I do not quite understand. I added space to different places, it still does not work
can you explain, or show me the correct space, where I should put
You can also use datetime() instead directly. I think sysdate was also system start up date, not necessarily current date if you don't shut down SAS every day.
footnote1 "Created on %sysfunc(datetime(), datetime21. )";
it does not work either, after I used the code above
@Bal23 wrote:
it does not work either, after I used the code above
What does that mean?
Post the exact code you ran and explain what didn't work please.
footnote1 "Created on %sysfunc(datetime(), datetime21.)" ;
49
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS
release. Inserting white space between a quoted string and the succeeding
identifier is recommended.
as a result, sas does not work any more, no result is generated afterwards
can you let me know how to fix it
I don't know what you did so not really. Footnotes/Titles don't stand on their own, you run them with a proc, so showing me a single line of code doesn't mean much.
You can try the SAS magic string to reset, usually this means you forgot a run or semi colon.
Does your header say a certain proc is running? You may just need to reboot the application.
;*';*";*/;
For footnotes either of these will work, if you use them correctly.
ods html;
proc print data=sashelp.class;
footnote1 "Created on %sysfunc(datetime(), datetime21.) ";
run;
proc print data=sashelp.air(obs=10);
footnote1 "Created on %sysfunc(date(), date9.) %sysfunc(time(), time8.) ";
run;
ods html close;
I think, @Bal23 had submitted the footnote statement (possibly twice) with unmatched quotes. Then, when the corrected statement was submitted, the text Created appeared after what was interpreted as the closing quotation mark. (I could replicate the issue.)
In this case the "magic string" should resolve the issue. Even the following short version should do.
";
thanks
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.