From: GuyA on 10 Aug 2010 06:13 Simple question. String: 14/9/2007 11:25:59 What's the correct informat for such a string? I just can't get it to work right, and end up scanning off the date and time to do separately. But I'm well aware that there is an informat for pretty much everything... Thanks.
From: Patrick on 11 Aug 2010 04:50 I believe that there is actually no pre-defined informat for this pattern of a datetime string. You'll have to continue doing what you're already doing.
From: Arthur Tabachneck on 11 Aug 2010 18:05 Guy, Simple answer: (1) declare options datestyle=dmy (2) use anydtdtm18. informat and (3) include an ampersand to read past the space. For example: options datestyle=dmy; data have; informat datetime anydtdtm18.; format date date9.; format time time8.; input datetime &; date=datepart(datetime); time=timepart(datetime); cards; 14/9/2007 11:25:59 12/7/2010 15:25:59 ; HTH, Art ------------ On Aug 10, 6:13 am, GuyA <guya.carpen...(a)gmail.com> wrote: > Simple question. > > String: > > 14/9/2007 11:25:59 > > What's the correct informat for such a string? I just can't get it to > work right, and end up scanning off the date and time to do > separately. But I'm well aware that there is an informat for pretty > much everything... > > Thanks.
|
Pages: 1 Prev: Need help--Cross Table Next: proc report / my image in on top of my table? |