Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resolving a macro variable to another macro variable

Status
Not open for further replies.

riskassure

Programmer
May 6, 2005
33
US
Hi, I have the following question:

I have a bunch macro variables defined in a program:

%let ADX = 2
%let BDX = 21
%let CDX = 13
%let DDX = 5
%let EDX = 10

later in the program, I have the following macro defined:

%macro test(z);
data newdates&z;
set olddates;
if ref in (&&z.dx) and state = &z;
run;
%mend test;

But when I run the following:

%test(a)

it gave me an error message. I want &&z.dx to first resolve to the macro variable adx, and then resolve that to 2. How do I achieve this?

Thanks in advance!

~~CW~~
 
Try one more '&' before the z.

ex.
Code:
if ref in (&&&z.dx) and state= &z;

Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top