BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

You did not provide enough examples of MON_QTR values to understand if it is supposed to represent MONTH or QUARTER. The values 1 to 3 could be valid for either. 

 

Also you did not show any examples of non-positive values of MON_QTR, but your %EVAL() calculations could generate such values.  Does that mean when the month part of Reportingdate is January that you only want to use data from January?  But when it is March you want to use data from January, February and March?

 

It looks like from your code that you expect MON_QTR to have values from -1 to 12.

 

Note that you can use the INPUT() function to convert values like '001' into the number 1.

David_Billa
Rhodochrosite | Level 12
Mon_Qtr value represent the values of months and it always positive.

Value of reporting date will always be any one of quarter ending date.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 16 replies
  • 2665 views
  • 3 likes
  • 5 in conversation