Date: Fri, 10 Feb 2006 21:46:10 -0500
Reply-To: Tony Yang <tonyyangsxz@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tony Yang <tonyyangsxz@GMAIL.COM>
Subject: Re: How to build Dynamic Variable names and values
In-Reply-To: <200602110102.k1AMTBPZ006441@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
*Chandra;*
From your question, it seems there is some rules for your new variable, if
we set i=1,2,3..., then the digit for RHS and LHS are i, the middle digit is
(i-1), based on this idea, you can just use a loop to do this.
I am not sure if your data is really like this, or something else.
On 2/10/06, SUBSCRIBE SAS-L Chandra Gadde <ddraj2015@gmail.com> wrote:
>
> Hello Everyone,
>
> Here is my scenario.
>
> I have a dataset named dsn. Here is how it looks.
>
> a11 a22 a33 a44 a55 a66 a77 a88 x
> 101 202 303 404 505 606 707 808 11
> 111 212 313 414 515 616 717 818 22
> 121 222 323 424 525 626 727 828 33
> 131 232 333 434 535 636 737 838 44
>
> Now, I need to create a new variable calld new_upb such that
>
> new_upb = a(x);
>
> Meaning if the value of x = 11 then new_upb = a11 (a11=101 in our case).
>
> In other words, New dataset will look like this
>
> a11 a22 a33 a44 a55 a66 a77 a88 x new_upb
> 101 202 303 404 505 606 707 808 11 101
> 111 212 313 414 515 616 717 818 22 212
> 121 222 323 424 525 626 727 828 33 323
> 131 232 333 434 535 636 737 838 44 434
>
> Could you please help me.
>
> Thank you.
>
--
Best regards,
Tony
|