LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 1997, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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?
Comments: To: zp00100@UABDPO.DPO.UAB.EDU
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


Back to: Top of message | Previous page | Main SAS-L page