BookmarkSubscribeRSS Feed
devarayalu
Fluorite | Level 6

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

3 REPLIES 3
shivas
Pyrite | Level 9

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

devarayalu
Fluorite | Level 6

Thanks for reply,

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

shivas
Pyrite | Level 9

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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