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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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