Date: Sat, 11 Feb 2006 01:42:10 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: How to build Dynamic Variable names and values
In-Reply-To: <200602110102.k1AMTBPZ006441@malibu.cc.uga.edu>
Content-Type: text/plain; format=flowed
chandra ,
If you have v9 you can do:
new_upb = vvaluex('a'||left(x)) ;
Toby Dunn
From: SUBSCRIBE SAS-L Chandra Gadde <ddraj2015@GMAIL.COM>
Reply-To: SUBSCRIBE SAS-L Chandra Gadde <ddraj2015@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: How to build Dynamic Variable names and values
Date: Fri, 10 Feb 2006 20:02:01 -0500
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.