Here are two methods. First, utilizing the CALL SYMPUT() function
to get your datastep working, along with matching up variable type
conversions a little bit, try this first example. Secondly, for those
who like to trim down to smaller code a second example using a
%LET and a %SYSFUNC() is provided in the second example.
(These examples tend to take your sample of using fixed literal date
values, if these are more dynamic, you will have to expand from here.)
month = 06;
year = 2001;
day = 30;
x = mdy(month,day,year);
%put yy is >&yy<;
Hope this is helpful,
Washington State Department of Social and Health Services
Division of Research and Data Analysis (RDA)
From: Draschner, Eugenio A [mailto:eugenio.draschner@OTS.TREAS.GOV]
Sent: Monday, August 27, 2001 9:39 AM
Subject: Macros and global variables
Wondering if any one of you could help with the following macro problem.
I have a macro which I want to use to create a global macro variable. I
want the name of this variable to be passed to the macro. I then want the
macro to assign a SAS date value to that global variable. I have the
following code, but I am not getting what I want. The local variable x has
the value (15156) I am trying to pass to the global variable (y), but the y
variable ends up with 'x' as a value. Any help would be most appreciated.
Regards to all.
month = '06';
year = '2001';
day = '30';
x = mdy(trim(month),trim(day),trim(year));
&macname = x;