Date: Tue, 15 Aug 2006 18:27:14 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: Convert MMYY columns to Column 1,2,3,4.....
On Mon, 14 Aug 2006 20:33:52 -0700, Eash <easwara@GMAIL.COM> wrote:
>Hi Louis,
>
>Thanks for your suggestion.unfortunately, I could not go for an array
>as I've 15+ columns like Amount , that counts for 15 columns * 24
>months in the array declaration.That makes my code so weird and tedious
>in iterating between one column to the other( like from Amount to
>purchase..etc..etc..
I don't think you've stated a good reason for dismissing arrays. When you
have a difficult problem you can't afford to dismiss things on whims. From
the little you have said about your task, it seems to me that arrays have a
lot of promise. Perhaps some metadata processing can help with the "tedious"
aspects.
You've said a bit about iterating, and about picking out 12-month series
from longer ones. Please elaborate a bit.
It might also help to explain the dimensions of the data. The monthly time
series are understood by now. What is the other dimension (15+) in the
columns? How does it enter into the logic of your task? What is the
dimension in the rows? Is it customer numbers or some such micro-level
idnetifier?
>
>Also note that I use SAS v8 and not v9.
>
>Thanks
>EasH
>LouisBB wrote:
>> Dear Easwara,
>>
>> Would defining an array ver the existing columns help you?
>> ARRAY MyAmount {*} Amount0803 Amount0903 Amount1003 Amount1103 Amount1203
>> Amount0104 ... Amount0805;
>> DO MyAmtIndex = 24 to 12 BY -1;
>> IF MyAmount {MyAmtIndex} > ... THEN DO;
>> ...
>> END;
>> END;
>> http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000201956.htm
>> http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000203460.htm
>>
>> LouisBB.
>>
>> "Eash" <easwara@gmail.com> wrote in message
>> news:1155610156.353492.130880@m79g2000cwm.googlegroups.com...
>> > HI All,
>> >
>> > I've a dataset with the columns like
>> > Amount0803,Amount0903,Amount1003,Amount1103,Amount1203,Amount0104,..upto
>> > Amount0805 (24 Amount columns for two years).
>> >
>> > Like Amount, I've 15+ columns.
>> >
>> > I need to iterate within these columns like 01,02,03,...upto 24,
>> > starting with the latest date as 01..i.e, 0805 as 01, 0705 as 02,0605
>> > as 03 (MMYY in descending).
>> >
>> > Pity myself as I cannot request the source system to change the data
>> > format in which I receive, as it'z a standard(??) they follow!
>> >
>> > My objective with this table is, given a date I should pick the older
>> > twelve months from this table.For example, If my Target period is
>> > August 2004, I need to pick twelve months from
>> > Amount0804,Amount0704,Amount0604....Amount0703(note: it picks the
>> > previous twelve months). I may be given 5 to 6 target periods.. So
>> > thought it will be easy if I rename the columns 01-24(having the latest
>> > as 01, so that for August 2004, i can pick the columns
>> > Amount13-Amount24 - which is Amount0804-Amount0903 before).
>> >
>> > Is there any feasible solution for this issue? Rename or iterate with
>> > existing structure??
>> >
>> > it'z more related to the approach, and will be happy if I get some
>> > ideas which can optimize the performance of my codes as the table holds
>> > 3GB+ data! :)
>> >
>> > Thanks
>> > Easwara
>> >
|