BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Giraffe123
Fluorite | Level 6

Hi! I'm quite new to SAS and would like your help on the following:

 

I'm trying to perform a do loop using macro variables from a specific start date to a specific end date.

I want the macro to perform on the startdate and the startdate + 1 month at a time. For instance:

 

startdate = Jan

Enddate = Dec

 

The first iteration should select Jan and Feb. Second iteration should select Feb and Mar. And this should be repeated until Nov and Dec.

 

Any help or tips on how I should approach this would be appreciated. Again, I'm new to SAS and not quite sure how macro coding works yet.

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think more context is needed. Saying you want JAN and FEB on the first iteration ... okay, how will JAN and FEB actually be used within the macro? Also, JAN and FEB ought to have year associated with it.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

I think more context is needed. Saying you want JAN and FEB on the first iteration ... okay, how will JAN and FEB actually be used within the macro? Also, JAN and FEB ought to have year associated with it.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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