Date: Fri, 29 Aug 2008 08:51:19 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Subject: Re: Character values to month
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]
|