Date: Fri, 9 May 2003 00:30:13 -0400
Reply-To: Vladimir Gretchko <vlad_gretchko@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Vladimir Gretchko <vlad_gretchko@HOTMAIL.COM>
Subject: how to translate char dat and time into date and time
Dear SAS group,
i have external data set with VISDT as char $25. like following:
10/16/02 07:00:03 (it is one value)
I try to get date and time in vars VISDATE and VISTIME, so I do:
DATA extdat;
SET extdat;
FORMAT VISDATE MMDDYY8. VISTIME TIME8.;
VISDATE=PUT(TRIM(LEFT(SCAN(VISDT,1,' '))), MMDDYY8.);
VISTIME=PUT(TRIM(LEFT(SCAN(VISDT,2,' '))), TIME8.);
RUN;
And LOG is:
12 VISDATE=put(trim(left(scan(VISDT,1,' '))), MMDDYY8.);
--------
48
ERROR 48-59: The format $MMDDYY was not found or could not be loaded.
NOTE: SCL source line.
13 VISTIME=put(trim(left(scan(VISDT,2,' '))), TIME8.);
------
48
ERROR 48-59: The format $TIME was not found or could not be loaded.
What I do wrong?
Thank you,
Vlad
|