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 (June 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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&gap;

output; end; Run; ***************************************************************************

How can I create these variable names on the fly???? Thanks, John

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