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 (April 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 29 Apr 2008 22:07:24 -0400
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: question on sas dates yyyymmdd8.
Comments:   To: "Howard Schreier <hs AT dc-sug DOT org>" <schreier.junk.mail@GMAIL.COM>

Harry,

All four methods produce the same results but, being a strong believer in parsimony, I have to vote for Howard's code.

Art --------- On Tue, 29 Apr 2008 19:55:14 -0400, Howard Schreier <hs AT dc-sug DOT org> <schreier.junk.mail@GMAIL.COM> wrote:

>On Tue, 29 Apr 2008 19:09:06 -0400, Arthur Tabachneck <art297@NETSCAPE.NET> >wrote: > >>Harry, >> >>Who am I to question data_null_? >> >>Regardless, I got it to work with input--input. E.g., >> >>data have; >> input num_dates; >> cards; >>20060607 >>20050822 >>20080429 >>; >> >>data want; >> set have; >> format date date9.; >> date=input(input(num_dates,$12.),yymmdd8.); > >Or just > > date=input(num_dates,yymmdd12.); > >>run; >> >>HTH, >>Art > >Also, there is an all-numeric approach: use numeric functions and operators >to extract the year, month, and date components, then use the MDY function >to construct the SAS date. > >>------- >>On Tue, 29 Apr 2008 18:50:47 -0400, Hari Nath <hari_s_nath@YAHOO.COM> >>wrote: >> >>>Hi all, >>> >>>I have a sas dataset which has numeric dates in the form 20060822 >>>all my proc contents says is that >>> >>> # Variable Type Len Label >>> >>>137 START_DT1 Num 8 START_DT1 >>> >>>I want to find a way to read them and format it to mmddyy8. >>> >>>am not successful so far....can someone guide me here..... >>> >>>Many thanks >>>hari.


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