Date: Tue, 14 Sep 1999 10:22:00 -0400
Reply-To: Mark Jordan <mark.jordan@CAPITALONE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mark Jordan <mark.jordan@CAPITALONE.COM>
Subject: FW: DateTime to String
Content-Type: text/plain; charset="US-ASCII"
This should do it:
DATETIME = INPUT(PUT(DATE,DATETIME18.),$18.);
Capital One Services, Inc.
Enterprise SAS Solutions
"Do witches run spell checkers?"
From: Natalie Herbert <herbert@NOVAWEBGROUP.COM>
Sent: Tuesday, September 14, 1999 9:20 AM
Subject: DateTime to String
I think I have seen a post on this before, but I can't seem to find it......
I'm trying to take a SAS datetime field, and insert it into an RDBMS (Sybase).
The problem, is that SAS stores the Datetime field as a number, and in order to
insert it (using
PROC SQL), I need it as a string. So, if I have a dataset DATA with the
variable DATE, and want to
insert it into an SQL table TABLE with field DATETIME, I would have:
insert into mylib.TABLE (DATETIME)
select DATE from work.DATA;
What I would like to do is take the dataset datetime variable, and create a new
databaset with a
string variable (with some format of the date and time that the SQL database
Anyone have any ideas? I've tried a few format statements, but with no luck.