BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Bal23
Lapis Lazuli | Level 10

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

13 REPLIES 13
Reeza
Super User

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

 

 

Bal23
Lapis Lazuli | Level 10

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

Reeza
Super User

Remove the %put

 

Bal23
Lapis Lazuli | Level 10

"
--------------
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.

Reeza
Super User

@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.

 

Bal23
Lapis Lazuli | Level 10

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

Reeza
Super User

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. )";
Bal23
Lapis Lazuli | Level 10

it does not work either, after I used the code above

Reeza
Super User

@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.

Bal23
Lapis Lazuli | Level 10

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

Reeza
Super User

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;

FreelanceReinh
Jade | Level 19

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.

";
Bal23
Lapis Lazuli | Level 10

thanks

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 1835 views
  • 3 likes
  • 3 in conversation