• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • Last Modified:

Last Month with appropriate year as a macro variable

Hi:

 I have a date from TODAY(), I need to create a macro variable with a value FILE<lastmnth's monthyear>. How can I do this?

For example if Today() is Jan 10 2010 then my macro variable would have a value FILEDEC2009
                                     is Dec 25 2009 then my macro variable would have a value FILENOV2009

Thanks!
0
LuckyLucks
Asked:
LuckyLucks
1 Solution
 
bradanelsonCommented:
This should give you what you are asking for.

DATA _NULL_;
    CALL SYMPUT('MacroVar','FILE'||PUT(INTNX('MONTH',TODAY(),-1),MONYY7.));
RUN;

%PUT &MacroVar;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now