Solved

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

Posted on 2013-05-15
2
334 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

820 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