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 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 6 Jul 2007 16:45:49 -0400
Reply-To:     "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject:      Re: Array Question : Accessing original variable name that
              indexed array variable points to
In-Reply-To:  <89C159F45B13A24682D98BDEF58E451F1066E4DE@TLRUSMNEAGMBX28.ERF.THOMSON.COM>
Content-Type: text/plain; charset=us-ascii

> From: matt.pettis > Subject: Array Question : Accessing original variable name > that indexed array variable points to > > Hi, > > Is there any function that allows me to access the variable > name of the variable that the current indexed array is > pointing at?

you want to RTFM on call vname

> Here is an example: > > data _null_;

attrib Vname length = $ 32;

> array x {3} a b c;

retain Testing 1;

> set work; > do i=1 to dim(x); > /* Is there a way to programatically see that */ > /* the name of the variable that */ > /* x{i} points to is 'a', 'b', or 'c', depending on */ > /* what value i is in the loop? */

call vname(x(I),Vname); if Testing then putlog Vname= X(I)=;

> end; > run;

I don't guarantee that the putlog will write both values

Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov


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