Solved

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

Posted on 2013-05-15
2
305 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
Comment Utility
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
Comment Utility
Works Great!  Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now