Time is AM, instead of PM, when using ODS RTF
by frethoa » Fri, 11 Apr 2008 07:21:11 GMT
To comp.soft-sys.sas --
I'm using ODS RTF to write SAS/GRAPH results to an RTF file. The date-
time stamp that gets written in the header of the RTF file is:
05:33 Wednesday, April 09, 2008
The only problem is, that the time is really 5:33 PM -- so it should
say either "5:33 PM" or (preferably) "17:33". Does anyone know how to
fix this? Thanks much!
--Tom
Re: Time is AM, instead of PM, when using ODS RTF
by art297 » Fri, 11 Apr 2008 11:38:53 GMT
Tom,
There is probably an option that I'm not familiar with but, regardless,
you can always simply turn off the date with options nodate and add a
title with the date or datetime in the desired format.
Take a look at the thread: http://www.**--****.com/
HTH,
Art
-----------
Re: Time is AM, instead of PM, when using ODS RTF
by Bill McKirgan » Fri, 11 Apr 2008 23:16:15 GMT
> - Show quoted text -
That was a great tip Aruthur... I saw that a few days ago and then
made one like this:
title2 "Double-Data Entry Progess report as of
%left(%sysfunc(today(),worddatx.) -- %sysfunc(time(),timeampm.))";
which produces this...
Double-Data Entry Progess report as of 10 April 2008 -- 9:11:07
AM
The OP on that thread was troubled by the fact that the SAS date/time
is always stuck at the time SAS is started, and when one keeps SAS
running all day long, as many of us do, then that timestamp is not
very helpful at reporting time.
Tom,
I know on XP the display of time is obvious am/pm. Maybe you're using
another OS and time is displayed differently ...is the time set
correctly? is the timezone set correctly? Sorry to ask the obvious,
but that's me sometimes, captain obvious....and sometimes I'm major
over-complicating things.
In any case, Arthur's tip should provide you with an effective work-
around; but I hope you can find and fix the 12-hour time error you
observe. Good luck!
Bill
Re: Time is AM, instead of PM, when using ODS RTF
by frethoa » Sat, 12 Apr 2008 02:36:49 GMT
Bill -- thanks! But I *am* using Windows XP. And my time & timezone
are set correctly (e.g. bottom right of screen shows "1:30 PM", which
is correct). I'm don't think that what I'm getting is actually a "12-
hour time error" -- i.e. the RTF file just produced by ODS RTF is
saying, in its header, "01:30", which technically is correct, but
CONFUSING since one might easily think it's AM, when it's really PM.
And yes, I suppose the workaround will work, but I'm still hoping to
find what's at the bottom of this! Thanks again ... Best, --Tom
Re: Time is AM, instead of PM, when using ODS RTF
by Richard » Sat, 12 Apr 2008 11:00:13 GMT
Another problem with this date and time is that its not fixed. Its
actually a field code DATE which returns todays date and time when the
file is opened so it keeps changing. Not sure why SAS did this as it
makes it pretty well useless!
R
Re: Time is AM, instead of PM, when using ODS RTF
by Richard » Sat, 12 Apr 2008 13:02:13 GMT
I think I have found the solution.
Use the SASDATE option in the ODS RTF statement. (uses the SAS date
time rather than the date the file is opened)
and use the system option
OPTION DTRESET /*resets SAS date to current date time for any printed
output*/
The result is the date and time in 24hr format and for the actual time
the proc is run.
Cheers
R
use
Re: Time is AM, instead of PM, when using ODS RTF
by Peter » Sun, 13 Apr 2008 00:22:47 GMT
> Another problem with this date and time s that its not fixed. I>s
> actually a field code DATE which returns todays date and time when t>e
> file is opened so it keeps changing. Not sure why SAS did this as >t
> makes it pretty well useles>!
> R
is that another example of the delights of ms-word !
For those of you who would like to place the title1 date information
into some other place, may I offer the (less-familiar) format TWMDY,
as in
%put %now( fmt= twmdy );
Here it is used on a title3, right aligned by ODS
title3 .j=R "%now(fmt=twmdy)" ;
That title uses the current timestamp rather than the time that a
title line would actually use. For the best approximation of that, use
%let titletime=%sysfunc( putn( "&sysdate9:&systime"dt, twmdy));
title3 .j=R "&titletime" ;
For the old listing destination, we don't enjoy that justification
convenience, so the title3 would need to be something like
option nodate ;
title1 "try puting date elsewhere";
title3 "%sysfunc( repeat( %str( )
, %eval( %sysfunc(getoption(ls))
-1-%sysfunc(length( &titletime))) )
)&titletime";
proc print data= sashelp.class;
run;
PeterC
Similar Threads:
1.reading long AM PM dates
I have A LOT of text data which includes a date field in the
format:
6/16/2005 8:21:17 PM
16/30/2005 11:06:32 AM
Can SAS read this informat directly or do I need to read
it as a string and then extract the info with scan?
Thanks;
2.SAS informat for date with AM PM
I have a column with date in character format like this
Jul/31/2007:1:34:47 PM
Jun/32/2007:12:41:45 AM
Is there a way to change this into a SAS date format.
Thanks
Suren
3.Datetime Value with AM/PM
Hello,
I have a tab-delimited file containing datetime values including AM/PM,
such as this:
10/01/2008 7:00:00 AM
Can anyone help me compose a datetime informat I can use to read this
value accurately?
Format DateTimeVar ???;
CharacterString = '10/01/2008 7:00:00 AM';
DateTimeVar = input(CharacterString,???);
Thanks.
4.Date format ddmmyyyy hh:mm:ss AM|PM
Hi all,
Is there any informat that can read the date time value given below:
"10/14/2006: 5:53:00AM"
Thanks,
jo.
5.reading excel datetime with AM PM
Hi,
I am trying to read EXCEL datetime cell format with AM PM.
I would like to learn how to deal with AM PM portion.
Thank you.
Excel Data:
1/1/2000 4:23:00 AM
1/1/2000 5:15:00 PM
Results I would like in SAS:
01JAN2000:04:23:00
01JAN2000:17:15:00
Codes I tried:
LibName xlsLib ".\Demo.xls"
mixed=yes
stringDates=yes
scanTime=yes
;
Data tod00 ;
Set xlsLib."sheet1$"n ;
Run ;
LibName xlsLib clear ;
data tod0;
set tod00;
dod_tod1 = input(substr(mytod,1,10),mmddyy10.)*86400 +
input(substr(mytod,12),time.);
format mytod1 datetime19.;
run;
6. ODS + Macro Manipulation maybe is needed for what I am trying to do
7. ODS RTF "Times New Roman" switches to "Times" ????
8. I am sorry,I am a newbie.Who can explain this for me?