BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ShrutiD
Fluorite | Level 6

Hello 

 

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

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

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

8 REPLIES 8
ChrisNZ
Tourmaline | Level 20

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.

 

 

ShrutiD
Fluorite | Level 6

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

 

ChrisNZ
Tourmaline | Level 20
This is the time you started the sas session.
Reeza
Super User

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

mkeintz
PROC Star

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

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Reeza
Super User

@mkeintz that's awesome!

ShrutiD
Fluorite | Level 6

Thank you all for the solution!!

 

ChrisNZ
Tourmaline | Level 20

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

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
  • 8 replies
  • 2002 views
  • 5 likes
  • 4 in conversation