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 (July 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 Jul 2008 08:47:42 -0400
Reply-To:   Muthia Kachirayan <muthia.kachirayan@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Muthia Kachirayan <muthia.kachirayan@GMAIL.COM>
Subject:   Re: addressing the data column as an "Array"
In-Reply-To:   <>
Content-Type:   text/plain; charset=ISO-8859-1

On Tue, Jul 29, 2008 at 7:15 AM, kunal <> wrote:

> Hi everyone!! > > I am trying to automate the multiplicative model(a double log model). > I have managed to do a bit of automation by using merge statements. > > The process can be significantly automated if we can use the column as > an array. > > For eg: > > Marks > 55 > 63 > 75 > 34 > 88 > 93 > > Marks is the column name and the values listed are the row values. Can > i know access column values as an array value such that a[0] = 55 , > a[1] = 63 and so on.?? > > can any1 gime me any pointers or code for doing this > ?? > > Thanks > Kunal >


You can have it. In one pass of dataset (within a datastep) you can load the values(Marks) into a TEMPORARY array say:

array a[NUM] _temporary_;

NUM is the number of Distinct values of Marks.

In the next Pass, within the same datastep, you can use a[1], a[2] ... a[NUM].

If you want to use a[0] to a[NUM] then declare the array (having NUM + 1 elements) as:

array a[0:NUM] _temporary_ ;

If you show some small example dataset then someone will show you the way to go with temporary array.

Muthia Kachirayan

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