Contributor
Posts: 49

# Why the y value is 02JAN12 in the intnx function?

77

78   data _null_;

79   x=intck('weekday17w', '01jan12'd, '31dec12'd);

80   y=intnx('weekday17w', '01jan12'd, 1);

81   put x= +1 y date.;

82   run;

x=261  02JAN12

NOTE: DATA statement used (Total process time):

real time           0.12 seconds

cpu time            0.00 seconds

Super Contributor
Posts: 349

## Re: Why the y value is 02JAN12 in the intnx function?

Hi,

What is the output you are expecting...

data _null_;

x=intck('weekday17w', '01jan12'd, '31dec12'd);

y=intnx('weekday17w', '01jan12'd, 1);

put x= +1 y weekdate17.;

run;

Thanks,

Shiva

Contributor
Posts: 49

## Re: Why the y value is 02JAN12 in the intnx function?

Generally weekday17w interval should give the 5 day week with saturday and sunday as the weekends.

So the next interval should be next week in intnx function and total number of 5 day weeks in the year in intck function

But this is not happening in my point of view

Super Contributor
Posts: 349

## Re: Why the y value is 02JAN12 in the intnx function?

Hi,

01Jan2012 is sunday.next day of weekday is monday which 02Jan2012,Your code is working correct right.

06Jan2012 is friday and its giving 09Jan2012 as weekday starts.

data _null_;

x=intck('weekday17w', '01jan12'd, '31dec12'd);

y=intnx('weekday17w', '01jan12'd, 1);

z=intnx('weekday17w', '06jan12'd, 1);

format y z date9.;

put (_all_) (=);

run;

x=261 y=02JAN2012 z=09JAN2012

Thanks,

Shiva

Discussion stats
• 3 replies
• 264 views
• 0 likes
• 2 in conversation