Mudcat
2007-12-28 00:06:25 UTC
Hi,
I'm new to SAS. I've searched through the posts but without knowing
the defintions of things yet haven't been successful in finding the
answer.
I am trying to create a SAS script that creates table or datasets
using a variable name. I'm updating existing SAS scripts that are run
on a monthly basis where the names have to be updated in multiple
locations each month. As a result, I'd like to create a variable at
the top for each month
For example...
It currently looks like this:
data lib.monthly_sep_oct_transition;
set lib.month_sep lib.month_oct;
....
<do stuff>
...
run;
I'd like to update them to look like this:
%let cur_month = oct
%let prv_month = sep
data lib.monthly_&prv_month_&cur_month_transition;
set lib.month_&prv_month lib.month_cur_month
....
Using variables I've tried several variations using quotations and
dots but just can't seem to make it work. An example or link to an
existing thread explaining this would be great.
Thanks.
I'm new to SAS. I've searched through the posts but without knowing
the defintions of things yet haven't been successful in finding the
answer.
I am trying to create a SAS script that creates table or datasets
using a variable name. I'm updating existing SAS scripts that are run
on a monthly basis where the names have to be updated in multiple
locations each month. As a result, I'd like to create a variable at
the top for each month
For example...
It currently looks like this:
data lib.monthly_sep_oct_transition;
set lib.month_sep lib.month_oct;
....
<do stuff>
...
run;
I'd like to update them to look like this:
%let cur_month = oct
%let prv_month = sep
data lib.monthly_&prv_month_&cur_month_transition;
set lib.month_&prv_month lib.month_cur_month
....
Using variables I've tried several variations using quotations and
dots but just can't seem to make it work. An example or link to an
existing thread explaining this would be great.
Thanks.