Solved

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

Posted on 2013-05-15
2
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

689 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