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 (August 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 29 Aug 2008 09:48:25 -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: Character values to month
Comments: To: "Howard Schreier <hs AT dc-sug DOT org>"
          <schreier.junk.mail@GMAIL.COM>

Howard,

You're right, of course, but the same code and result would have been obtained:

data have; format Txt $2.; do i = 1 to 12; Txt=input(put(i,2.),$2.); output; end; run;

data want; set have; format mon3 monname3.; Mon3 = txt*29; run;

proc print;run;

Art -------- On Fri, 29 Aug 2008 08:51:19 -0400, Howard Schreier <hs AT dc-sug DOT org> <schreier.junk.mail@GMAIL.COM> wrote:

>On Fri, 29 Aug 2008 08:17:24 -0400, Arthur Tabachneck <art297@NETSCAPE.NET> >wrote: > >>Nat, >> >>How about a solution with NO functions? >> >>Data Mon; >> format mon3 monname3.; >> Do Txt = '1' to '12'; >> Mon3 = txt*29; >> output; >> end; >>run; >> >>proc print;run; >> >>This MUST be Friday, >>Art > >OK, but it still does not quite model the original problem because TXT is >numeric. > >[snip] > >>>>> From: DP >>>>> >>>>> Can anyone please tell me how to convert a character value to >>>>> month? For >>>>> instance, convert '1' to Jan, '2' to Feb, '3' to Mar, etc... >>>>> One thing I can think of is to create a format and then apply >>>>> the format to >>>>> the variable. Is there another efficient way of doing this? > >[snip]


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