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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 263 views
  • 0 likes
  • 2 in conversation