Solved

Using the literal month value from a date as a macro within a macro

Posted on 2013-05-15
2
325 Views
Last Modified: 2013-05-16
Experts,

I don't know if this can be done, but I have a macro that is doing some processing.
I would like to  read the dates.
%MACRO Enroll(enrldt);
   ..................Processing.......................
%MEND;

%Enroll('01JAN2013'D);
%Enroll('01FEB2013'D);
%Enroll('01MAR2013'D);
%Enroll('01APR2013'D);
%Enroll('01MAY2013'D);

The compare within the macro is working fine.

 if datepart(First_Enrollment_Date) = &enrldt;

If possible, I would like to use the literal month from the dates listed (Format monname3.) to concatenate the output table being created so it would be:
LOB_JAN
LOB_FEB
LOB_MAR
LOB_APR
LOB_MAY

Is there a way to do this.  Open to any suggestions.

In addition, I would like to export the created table in the macro using the concatenated table name
PROC EXPORT DATA=LOB_JAN  OUTFILE=........
0
Comment
Question by:morinia
2 Comments
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 total points
ID: 39170440
Hi

Use:
DATA LOB_%SYSFUNC(PUTN( &enrldt, MONNAME3.));
  SET DS_NAME;
 ...
RUN;

PROC EXPORT DATA=LOB_%SYSFUNC(PUTN( &enrldt, MONNAME3.)) OUTFILE=......;
RUN;

Open in new window

0
 

Author Closing Comment

by:morinia
ID: 39171738
Works Great!  Thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question