Date: Tue, 16 Dec 1997 08:42:31 -0500
Reply-To: Prasad Ravi <prasad_ravi@SMTP-GATEWAY.POLK.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Prasad Ravi <prasad_ravi@SMTP-GATEWAY.POLK.COM>
Subject: Re: How to change format types in PROC SQL?
Content-Type: text/plain; charset=US-ASCII
Tang:
You can use the same INPUT function you use in data step to convert
character variable to numeric in SQL also, in order to convert the
char var to date format first convert it to sas date and then apply
the mmddyy10. format.
example:
PROC SQL;
CREATE TABLE NEW(DROP=CHARVAR) AS
SELECT *, INPUT(CHARVAR,8.) AS NUMVAR
/** OR INPUT(CHARVAR,MMDDYY10.) AS SASDATE,
PUT(CALCULATED SASDATE,MMDDYY10.) **/
FROM YOURDATA;
QUIT;
RUN;
Prasad Ravi.
______________________________ Reply Separator _________________________________
Subject: How to change format types in PROC SQL?
Author: Tang <zp00100@UABDPO.DPO.UAB.EDU> at INTERNET-MAIL
Date: 12/15/97 10:47 PM
Dear friends, please help me solve this problem.
I try to use PROC SQL to convert a column of string ($10.) into a column of
numeric value or a date format (mmddyy10.). How can I do that?
Thank you for your help.
Tang
|