Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compare and update data between two databases 6 58
microsoft access question 8 52
Need way to extend view in MS Access 47 73
Save conflict messages on existing documents 15 55
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…

863 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

22 Experts available now in Live!

Get 1:1 Help Now