BookmarkSubscribeRSS Feed
Shara
Calcite | Level 5

I'm hoping I can write a macro to run the same piece of code a number of times.

I want to run it once per month on the last day of the month beginning June 30, 2012 to June 30, 2013.

Dates always trip me up when I want to have the date update each time through.

I will have a prompt for the user to enter the start date and the end date (in case they want to change the date ranges).

Any help structuring the macro so the month end date changes each pass through would be so welcomed!

Thank you.

1 REPLY 1
PaigeMiller
Diamond | Level 26

I think you would want to use the INTNX function, with the alignment parameter set to E.

You could also include this calculation in the %SYSFUNC macro function, and put it in a macro loop to increment to the last day of the next month each iteration of the macro.

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1160 views
  • 0 likes
  • 2 in conversation