DATA Step, Macro, Functions and more

Date time stamp

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Date time stamp

Hello 

 

Please help me in changing the date, time stamp set for SAS 9.1 as it is incorrect.

 

 


Accepted Solutions
Solution
‎02-26-2018 10:30 AM
Trusted Advisor
Posts: 1,297

Re: Date time stamp

@ShrutiD  Your question has motivated me to see if there is an option to control the date/time info on listings and logs.  And I've learned that there is:

 

 

OPTIONS NODTRESET;

means that the session start date and time are used in your procedure printout.  This is the sas default on all the systems I have used.

 

OPTIONS DTRESET;

means that the time of procedure execution is used.

 

The options statement is global.  I.e. it doesn't belong to a proc step or data step.  When you issue it, all subsequent steps honor it.

So put OPTIIONS DTREST prior to your proc's of interest.  And, if you want, it turns out you can go back to the sas default by issuing OPTIONS NODTRESET after those proc's.

View solution in original post


All Replies
PROC Star
Posts: 2,231

Re: Date time stamp

You give give us fewer details but that would be hard.

 

What do you have? What do you want?

 

And provide a proc contents of the table if you are talking about data sitting in a table.

 

 

Occasional Contributor
Posts: 5

Re: Date time stamp

Hello Chris

 

As I am new to SAS, I would request you to help me know how to change the date time stamp seen at the output window 

 

for example in the below date time stamp,I need to alter the day shown(Thursday) as it is incorrect.

 

12:33 Thursday, February 25, 2018 1

 

PROC Star
Posts: 2,231

Re: Date time stamp

This is the time you started the sas session.
Super User
Posts: 22,875

Re: Date time stamp

If you're referring to the date time that is printed by default at the bottom of a report, then the default system date is the date the SAS session was started. If you want the date/time you can use the following:

 

%put %sysfunc(date(), worddate.);

%put %sysfunc(datetime(), datetime.);

This means turning off the SAS default and adding your own date time to the report or ensuring that you use a clean session when submitting a report - i.e. if you run a report via batch process or stored process I would expect it to have the latest date. 

 

footnote1 "This report was run on: %sysfunc(date(), worddate.)";

proc print data=sashelp.class (obs=5) noobs label;
run;

Note this doesn't seem to work on SAS UE for some reason, or at least mine is still reporting the session date:

 

Screen Shot 2018-02-25 at 10.31.26 AM.png

Solution
‎02-26-2018 10:30 AM
Trusted Advisor
Posts: 1,297

Re: Date time stamp

@ShrutiD  Your question has motivated me to see if there is an option to control the date/time info on listings and logs.  And I've learned that there is:

 

 

OPTIONS NODTRESET;

means that the session start date and time are used in your procedure printout.  This is the sas default on all the systems I have used.

 

OPTIONS DTRESET;

means that the time of procedure execution is used.

 

The options statement is global.  I.e. it doesn't belong to a proc step or data step.  When you issue it, all subsequent steps honor it.

So put OPTIIONS DTREST prior to your proc's of interest.  And, if you want, it turns out you can go back to the sas default by issuing OPTIONS NODTRESET after those proc's.

Super User
Posts: 22,875

Re: Date time stamp

@mkeintz that's awesome!

Occasional Contributor
Posts: 5

Re: Date time stamp

Thank you all for the solution!!

 

PROC Star
Posts: 2,231

Re: Date time stamp

[ Edited ]

Also, I marked your other -identical- question as spam to avoid duplicates.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 260 views
  • 5 likes
  • 4 in conversation