tag:blogger.com,1999:blog-7958828565254404797.post2379718042583027006..comments2024-03-29T00:02:14.892-07:00Comments on ListenData: SAS : INTNX Function with ExamplesDeepanshu Bhallahttp://www.blogger.com/profile/09802839558125192674noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-7958828565254404797.post-53274336563751845082023-06-19T04:10:01.570-07:002023-06-19T04:10:01.570-07:002023-06
2023
2023-04
2023-08-12
2023-0
2023-09
.
I...2023-06<br />2023<br />2023-04<br />2023-08-12<br />2023-0<br />2023-09<br />.<br />If the month is=/GT than 6 date should be 31, if the month is LT 5 date should be first of the month, if date is '.' the it should be 2022-12-31, how can we get the answer by using intnx functionMiheekahttps://www.blogger.com/profile/13513849928063130203noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-72834985433538545222021-07-08T19:08:02.570-07:002021-07-08T19:08:02.570-07:00Hi Himanshu,
In 5th point adjustment of interval ...Hi Himanshu,<br /><br />In 5th point adjustment of interval isn't it intnx function, it's updated as intck function.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-16485677271810202312021-01-02T12:58:59.512-08:002021-01-02T12:58:59.512-08:00Obs Date Scd_dep arr_ti...Obs Date Scd_dep arr_time delay<br /><br />6210 12/03/2013 8:35:00 PM 8:53:00 PM 18 <br />6211 11/11/2013 2:59:00 PM 2:56:00 PM -3 <br />6212 12/19/2013 8:27:00 PM 8:22:00 PM -5 <br />6213 11/12/2013 8:30:00 AM 10:06:00 AM 96 <br />6214 12/21/2013 2:59:00 PM 3:27:00 PM 28 <br />6215 12/10/2013 8:35:00 PM 8:31:00 PM -4 <br />6216 02/15/2013 3:05:00 PM 3:03:00 PM -2 <br />6217 12/05/2013 8:35:00 PM 12:27:00 AM -1208 ( incorrect)<br /><br />how to get correct answer for obs no. 6217 ( i am using intck) .How to calculate date if time changes from 23:59 to 00:40 ( next day ).<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-58917644249491766042020-10-15T23:57:17.287-07:002020-10-15T23:57:17.287-07:00Hlo,u can use the function intck.then the output ...Hlo,u can use the function intck.then the output comes wrong.<br />u can use intnx function then perfectly u got the o/p.Anonymoushttps://www.blogger.com/profile/16054552801247046671noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-18800904698895812272020-03-20T11:40:23.292-07:002020-03-20T11:40:23.292-07:00I want more logics in sasI want more logics in sasAnonymoushttps://www.blogger.com/profile/04032513076340763510noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-7082961362998580482020-03-20T11:39:46.374-07:002020-03-20T11:39:46.374-07:00SasSasAnonymoushttps://www.blogger.com/profile/04032513076340763510noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-74163229418018283242020-03-20T11:39:26.662-07:002020-03-20T11:39:26.662-07:00I want more logics in sad I want more logics in sad Anonymoushttps://www.blogger.com/profile/04032513076340763510noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-67230347020001484022019-06-10T14:23:44.900-07:002019-06-10T14:23:44.900-07:00You can use below code
Data temp;
Mydate="&...You can use below code<br /><br />Data temp;<br /><br />Mydate="&SYSDATE"d;<br />Nxt2ndstdy=intnx('week.7',intnx('month',Mydate,1),2);<br /><br />Format Mydate Nxt2ndstdy date9.;<br /><br />Proc print data = temp;<br /><br />Run;Rajendranoreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-4062220420087186552019-06-10T11:47:57.645-07:002019-06-10T11:47:57.645-07:00u mistakenly used intck here.u mistakenly used intck here.Anonymoushttps://www.blogger.com/profile/13126892196350959377noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-56401799733578224492019-02-09T23:47:54.709-08:002019-02-09T23:47:54.709-08:00Hi
How to find out next month second Saturday usin...Hi<br />How to find out next month second Saturday using today's date in SAS<br />Anonymoushttps://www.blogger.com/profile/12106451732270875849noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-80227243103755072112019-02-05T08:22:43.230-08:002019-02-05T08:22:43.230-08:00HEY: when i m running the code its showing like th...HEY: when i m running the code its showing like this.<br />code:date temp;<br />mydate='05feb2018'd;<br />nextsunday=intck('week',mydate,1)<br />format mydate nextsunday date9.;<br />run;<br /><br />output:18sep1951.<br /><br />this is the output coming please help me out.Shivangihttps://www.blogger.com/profile/06982284823277741012noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-82036995863865912782019-02-02T23:05:27.088-08:002019-02-02T23:05:27.088-08:005. Adjustment within the Interval
This program ex...5. Adjustment within the Interval<br /><br />This program explains how INTCK function adjusts / align dates within the interval specified.<br /><br />in that we are using intnx ...you have wrote intck thats the mistake ....<br />website is really fantastic ...Sharath reddyhttps://www.blogger.com/profile/15483254502864267286noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-83227656785159656762018-11-09T23:43:37.968-08:002018-11-09T23:43:37.968-08:00Thank you for stopping by my blog and answering qu...Thank you for stopping by my blog and answering questions. Cheers! Deepanshu Bhallahttps://www.blogger.com/profile/09802839558125192674noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-68022386841049519382018-11-09T08:43:16.960-08:002018-11-09T08:43:16.960-08:00This is a fantastic tutorial. Thank you for provid...This is a fantastic tutorial. Thank you for providing it! I am troubleshooting another developer's code that contains this function, and this information has been very helpful. Hope it's OK I answered a couple of questions above! I couldn't resist distracting myself from my current work to try out this function. :-)Katehttps://www.blogger.com/profile/05961465728584782293noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-43226670789729878242018-11-09T08:39:50.367-08:002018-11-09T08:39:50.367-08:00This will do it:
data test;
sunday = '18MAR20...This will do it:<br /><br />data test;<br />sunday = '18MAR2018'd;<br />tues = intnx('week.3',sunday,1);<br />format sunday tues date9.;<br />proc print data=test; run;<br /><br />Your current code finds the beginning of the week 2 weeks from now. The code I suggest gives you the beginning of the week 1 week from now, where each week begins on a Tuesday (day 3).Katehttps://www.blogger.com/profile/05961465728584782293noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-83234655408466870142018-11-09T08:34:16.692-08:002018-11-09T08:34:16.692-08:00Adding 's' as the 4th parameter will accom...Adding 's' as the 4th parameter will accomplish this.<br /><br />data test;<br />datetime = '29JAN2017:08:34:00'dt;<br />plus1hour = intnx('hour',datetime,1,'s');<br />format datetime plus1hour datetime20.;<br />proc print data=test; run;Katehttps://www.blogger.com/profile/05961465728584782293noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-6155078695991078842018-05-22T23:12:12.768-07:002018-05-22T23:12:12.768-07:00Hi deepanshu,
Thanks a lot for this info.However i...Hi deepanshu,<br />Thanks a lot for this info.However i have a question , i am trying to run a code that gives me next tuesday ,For 18Mar 2018 is sunday and i want to get 20 March as my answer.I am using tues = intnx ('week',sunday,2); and i am getting 1 April as answer . Any Advise Anonymoushttps://www.blogger.com/profile/07001155667207010651noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-77293791875427627812017-07-26T02:28:53.817-07:002017-07-26T02:28:53.817-07:00Thank you for this high quality introduction to th...Thank you for this high quality introduction to the INTNX function with great examples that are nicely explained and very readable :o) Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-54188899382183497352017-06-07T18:43:25.558-07:002017-06-07T18:43:25.558-07:00Hi Deepanshu,
Under "Datetime Formats" h...Hi Deepanshu,<br />Under "Datetime Formats" heading , when we add hour to the time , it should have been 9:34:00.ideally. How do we achieve this ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-46277947742783739822017-06-02T02:22:38.305-07:002017-06-02T02:22:38.305-07:00how to extract last 15 days transaction date wise ...how to extract last 15 days transaction date wise using this.Anonymoushttps://www.blogger.com/profile/12571346063006058230noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-53002752744964037622017-03-26T01:40:01.149-07:002017-03-26T01:40:01.149-07:00It works fine for '09JAN2017' which is mon...It works fine for '09JAN2017' which is monday. I guess you meant to say '10JAN2017'. I updated the code. Thanks for pointing it out. Cheers!Deepanshu Bhallahttps://www.blogger.com/profile/09802839558125192674noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-72942858932733193812017-03-25T14:40:46.365-07:002017-03-25T14:40:46.365-07:00Don't you think that "4. When was Last Tu...Don't you think that "4. When was Last Tuesday?" will give the current week's Tuesday instead of "Last Tuesday", if you give "09JAN2017" in mydateAnonymoushttps://www.blogger.com/profile/06377626589861778887noreply@blogger.comtag:blogger.com,1999:blog-7958828565254404797.post-79300075320930153782017-02-03T11:42:35.683-08:002017-02-03T11:42:35.683-08:00the only issue with intnx and intck is that its ha...the only issue with intnx and intck is that its hard to distinguish to make a short form as other function in sas can be remembered easily. Arunhttps://www.blogger.com/profile/01957551518340210738noreply@blogger.com