Date: Mon, 28 Jun 2004 16:41:12 -0400
Reply-To: "John J. Gilroy" <jjgilroy@HOUSEHOLD.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "John J. Gilroy" <jjgilroy@HOUSEHOLD.COM>
Subject: Dynamic Variable Problem, Help!!!
I am trying the following in an effort to create a dynamic variable name
that is dependent on the difference, months (can change from observation to
observation) between a date variable and the system date. Here is what I've
tried, and now realize 2 reason it will not work (macro variables not
resolved until datastep execution, and int function needs a number):
****************************************************************************
Data Temp;
Merge Dataset1 (In=A)
Dataset2 (In=B);
by custidno appseqno;
If A and B then do;
G2 = INTCK('MONTH',CONTDT,"&SYSDATE"D);
G1 = INPUT(G2,2.);
%LET GAP = %SYSFUNC(INT(G1));
Balnet&gap = Balnet;
or I would like to do:
Rename Balnet = Balnet⪆
output;
end;
Run;
***************************************************************************
How can I create these variable names on the fly???? Thanks, John
|