What does adding MONTH.1 do for a custom interval in the INTNX function?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

What does adding MONTH.1 do for a custom interval in the INTNX function?

Hello,

I'm new to SAS programming and I have a syntax question on the INTNX function.  I inherited a program which has the following % let statement below and I don't understand the first argument used in the INTNX function with "MONTH.1" as the custom interval.  I don't understand exactly what the .1 added to MONTH is doing.  I've searched quite a bit on the internet for a similar example explaining multipliers and shifting intervals but I haven't seen a similar example.  Is this redundant coding to add .1 to MONTH when running a program monthly?  Would it still return the same result if the .1 was omitted?  The code is intended to return the prior year and month to the month in which you run the program.

 

%let final_model = cvm2.final_cv_model_%SYSFUNC(intnx(MONTH.1,"&SYSDATE"D,-1), YYMMN.);

 

Thank you in advance for your help,

Eric


Accepted Solutions
Solution
‎05-18-2016 04:20 PM
Super Contributor
Posts: 406

Re: What does adding MONTH.1 do for a custom interval in the INTNX function?

[ Edited ]

Hi Eric,

 

The general form of an interval is

 

name<multiplier>.<shift-index>

 

In your case MONTH and MONTH.1 are equivalent. The multiplier and shift iidex allow you to specify intervals that begin in different parts of the year.

 

You can find the documentation on date and time intervals on the SAS support site: Date and Time Intervals.

 

Hope this helps,

- Jan.

View solution in original post


All Replies
Solution
‎05-18-2016 04:20 PM
Super Contributor
Posts: 406

Re: What does adding MONTH.1 do for a custom interval in the INTNX function?

[ Edited ]

Hi Eric,

 

The general form of an interval is

 

name<multiplier>.<shift-index>

 

In your case MONTH and MONTH.1 are equivalent. The multiplier and shift iidex allow you to specify intervals that begin in different parts of the year.

 

You can find the documentation on date and time intervals on the SAS support site: Date and Time Intervals.

 

Hope this helps,

- Jan.

Occasional Contributor
Posts: 13

Re: What does adding MONTH.1 do for a custom interval in the INTNX function?

Thank you Jan! Smiley Happy
Super Contributor
Posts: 406

Re: What does adding MONTH.1 do for a custom interval in the INTNX function?

You're welcome. If it really was what you were looking for please consider flagging my response as a solution.

Regards Jan.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 425 views
  • 2 likes
  • 2 in conversation