Date: Tue, 10 Dec 2002 15:33:40 GMT
Reply-To: julierog@ix.netcom.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roger Lustig <trovato@BELLATLANTIC.NET>
Subject: Re: convert column name to variable (day of month)
Content-Type: text/plain; charset=us-ascii; format=flowed
Sorry, folks--my old-fashioned (or misinformed) ways got the better of
me there.
Thanks!
Roger Lustig
Quentin McMullen wrote:
> Roger Lustig wrote:
>
>>This is what arrays are for!
>>
>>data new (keep=date value);
>>set old;
>>array days (31) day1-day31;
>>do I=1 to 31;
>> if day(I) > 0 then do;
>> **Use other ways of getting date if you prefer;
>> date = mdy(month,I,year-2000);
>
> ^^^^^^^^^
>
>> value=day(I);
>> output;
>> end;
>> end;
>>run;
>>
>
>
> Hi Roger,
>
> I like the solution. But since the MDY function (and I would hope all SAS
> date functions) is happy with a 4-digit year, I'm wondering why you would
> convert to a 1-digit year, thus relying on the yearcutoff option to guess
> the correct century? Is there some benefit to this that I am unaware of?
>
> Kind Regards,
> --Quentin
|