|Date: ||Sat, 10 Apr 2010 07:14:14 -0700|
|Reply-To: ||HealthMaps <healthmaps@COMCAST.NET>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||HealthMaps <healthmaps@COMCAST.NET>|
|Subject: ||Re: Reading a CSV format date & time into SAS|
|Content-Type: ||text/plain; charset="us-ascii"|
Either. I am happy with a date time variable or separate date and time
variable. I know how to go back and forth. (I think) I will be using the
combined to calculate a time interval, this is traffic collision data and I
want time to the hospital from various time parameters of a car crash (when
the police arrived, when EMTs showed up, etc) and separately because I need
to determine what part of the day the time value refers to (after midnight,
8am-noon, etc) and also the date to look at seasonality.
And of course, guess I am a bit too lazy, I can read it in as a character
variable and since the time and date parts are the same length I can use
SUBSTR to suck the date and time part out and then convert the resulting
strings to date and time. I was thinking that there would be a one step
solution with some function I could not find/don't know about (yet).
How would you do it?
Thanks for your help.
From: Schwarz, Barry A [mailto:email@example.com]
Sent: Friday, April 09, 2010 3:15 PM
To: healthmaps@COMCAST.NET; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Reading a CSV format date & time into SAS
You can always read it as a character variable (the imbedded space is
obviously not a problem since you can handle Porky Pig).
So tell us what you really want. Do you want the result to be a datetime
variable or a date variable and a separate time variable?
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, April 09, 2010 2:20 PM
Subject: Reading a CSV format date & time into SAS
In a large dataset in CSV format (million records) I have discovered date
and time formats (just a space between the date and time) for example: date
is year-month-day time is 24 hour
a typical sequence of the CSV data is
Pig,1,,3,2,1,2006-11-02 19:22,0,0,0,0,1 etc
I know how to handle the rest of it, but what is the correct way to read