| Date: | Thu, 16 Nov 2000 17:12:36 +1100 |
| Reply-To: | "short, chris" <cshort@ABARE.GOV.AU> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "short, chris" <cshort@ABARE.GOV.AU> |
| Organization: | Australian Commonwealth Department of Agriculture,
Fisheries and Forests http://www.daff.gov.au/ |
| Subject: | string to time format |
|---|
Are there any suggestions for reading a time string to a SAS dateTime value:
I have a string variable with values like:
"1999/05/01 04:05"
to convert it to a dateTime I do the following:
dtemp = substr (tradper,1,10);
tradeDate = input (dtemp, yymmdd10.);
ttemp = substr (tradper,12,6);
tradeTime = input (ttemp, time5.);
bidDateTime = tradeDate * (60*60*24) + tradeTime;
I was wondering if this could be done with an (custom?) informat.
The only informat that came close was DATETIMEw. - but this is for ddmmyyyy
hh:mm:ss format whereas I have yyyymmdd hh:mm:ss format.
Any suggestions would be appreciated - (coz this operation is done millions
of times).
Perhaps I should just stick with what works :-)
Cheers,
Christopher
----------------------------------------------------------------------------
Christopher Short
Senior Economist
Australian Bureau of Agricultural and Resource Economics
email: cshort@abare.gov.au
ph: +61 2 6272 2083
fax: +61 2 6272 2328
|