SAS tracks dates as the number of days since January 1st, 1960. SELECT A. For instance Clent A has first_date_deposit as 15/07/2003 and last_date_deposit as 24/02/2010. Finding the first day of the previous month is an ideal situation for using the INTNX function. INTCK( 'datetime-interval', datetime1, datetime2) returns the number of boundaries of intervals of the given kind that lie between the two date or datetime values. Syntax INTCK in SAS: INTCK (‘Interval’, start_date, end_date) Interval – can be in minutes, seconds, hours,weeks, days, months,quarter and year. The syntax of INTCK function is as follows: INTCK (interval, start date, end data, method) interval: Interval to calculate (day, week, month, quarter, year etc. sas. SAS intck function return wrong. end1=input (end,yymmdd8. If you are moving by the unit that the values are stored in you can just use arithmetic. ); start set: The initiate date; out target: The stop date; method: Count. dev. Artificial Intelligence. “The INTCK function counts the number of intervals between the two dates and returns a number. The YRDIF function can compute a person’s age. The difference between these two dates is 10 days but just because the month has changed from March to April, the INTCK function (with discrete method) considers the difference between them to be 1 month. Especially when trying to find newborns where age is less than 1. INTNX shifts a date by a specified interval, while INTCK computes the intervals between two dates. Consider the following examples: Using INTCK and INTNX. If you accessed TD via a LIBNAME engine, INTCK would work, as the function would be invoked on the SAS' side after having the TD date translated into the SAS date. In SAS 9. Given that the original question represented dates, using the HOURS interval with date values. SAS : INTCK Function with Examples / INTCK and INTNX: Two essential functions for computing intervals between dates in SAS - The DO Loopintck: 날짜 차이 계산 *intck('day',~) : 일자 차이 intnx: 날짜를 입력 값 만큼 이동 *intnx('month',기준 날짜, 이동할 날짜구간, '옵션') : 월 기준 날짜 이동 *옵션-'s' : 동일한 날짜-'b' : 이동한 날짜 구간의 첫번째 날-'e' : 이동한 날짜 구간의 마지막 날Returns the difference between two dates to the nearest number of months. The INTCK () function allows last argument to be either C or D. 2' et al) (and I've never personally had a reason to use them), I'll keep on using arithmetic,. You can add the 'SAME" option if you want it to move to the same relative point in the interval. If you've got already a data set with your company holidays then you could simply create a data set with all dates from Monday to Friday and also exclude all dates which are company holidays. . Thus the "weekdays" involved in the calculation of days1 are 1-2-3/4/5, where / indicates the counted boundaries. The time unit can be selected in years, months, weeks, days, or whatever you feel like. Renaming date variable to perform an intck to calculate day difference. e. Below you find an example of how to convert a Date variable into a DateTime variable. . mnthnum1=intck ( 'month', '25aug2000'd, '05sep2000'd); mnthnum1=1. . DATA y; SET test; Minutes = INTCK('minute',start,end); PROC PRINT DATA=y; VAR Start End Minutes; WHERE mapinfoid<4; RUN; Obs Start End FTMinutes 1 31DEC01:22:00 01JAN02:02:00 240. For the period unit, you can choose years, months, weekly, life, and more. data new_data; set original_data; new_value = round (value); run; . You will get better and faster answers when you specify the entire set of requirements in your original question. You will have to create a new variable in DATA step creating a new data set. days=intck ("day", start, end+1); But since DATE values are just number of days you can also just subtract. Date1: 09/02/2011. «. ちなみに同じ結果を返す他の計算式として、以下2つ. Interested in speaking?Example 22. Start_date and end_date are between two dates which we will be finding interval. The syntax is very similar to the INTNX function, INTCK(interval, from, increment, alignment). start-date: a Date or DateTime. ) If you prefer to learn by watching (while listening. (month) Parameter 2 is the start date. days=end - start + 1 ; Share. The INTCK function returns the months between &start_dt and. options intervalds= (BankingDays=BankDayDS); data BankDayDS (keep=begin); start = '15DEC1998'd; stop = '15JAN2002'd; nwkdays = intck ('weekday',start,stop); do i = 0 to nwkdays; begin = intnx. The code is missing the %SYSFUNC() required for using functions in macro logic. For example, the INTCK () can be used to determine how many months to generate. The INTCK Function your utilised to calculate the difference between two dates and times. Instead of adding just one interval, you can use the increment argument also to add multiple intervals to a. 関数INTCK('MONTH', '1feb2021'd, '31jan2021'd)では、1番目の日付が2番目の日付よりも1つ後の別の間隔内に存在するため、-1を返します。(1番目の日付が2番目の日付よりも後で、2つの日付が同じ間隔内に存在しない場合、INTCKは常に負の値を返します)。 Posted 08-31-2017 12:11 AM (7829 views) | In reply to EEEY. For more information about working with date and time intervals, see Date and Time Intervals. The INTNX function increments a date, time, or datetime value by intervals such as DAY, WEEK, QTR, and MINUTE, or a custom interval that you define. You can use the INTCK function in SAS to quickly calculate the difference between two dates in SAS. In some cases, like when calculating small date differences, it might not make sense to use the FLOOR function. com1 Answer. com. To represent a date in a program just use a quoted string followed by the letter D. The INTCK function in SAS can be used to calculate the difference between two dates in SAS. Details . So you could just subtract the two variables and divide by 60 seconds/minute to convert the units from seconds to minutes. ) The following example shows how to determine the date of the start of the week. data new; set test; nmonths=intck('month',assign_date,completed_date); run; proc print data=new; var assign_date completed_date nmonths; run;Re: calculating calendar days and work days with intck. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. (end_dt) Parameter 4 is the method. INTCK ( interval, from, to ) ; The arguments of the INTCK function are as follows: interval. How can I get the difference of the month, which is 1. I am still not sure I understand what your looking to produce in the query. And this is the logic: Work start time: 9am. It can be year, month, week, or weekday. You could ask for "dtmonth" to get the months between or "dtyear". 11 from Combining and Modifying SAS Data Sets - Examples. )); put _all_; datalines; 07:00. ),input (booked_to,time5. The following example uses the DATEDIFF() function to compare the requested delivery date with the ship date in days and return if the order is on-time or late:. Partial intervals are not counted. This seems to do what you are looking for. The INTNX function returns the SAS date value for the beginning date, time, or datetime value of the interval that you specify in the start-from argument. (To convert the SAS date value to a calendar date, use any valid SAS date format, such as the DATE9. Second point - won't happen. The age computation takes into account leap years. SAS : INTCK Function with Examples - Example 11: Loop through Dates Using a Macro. ) If you prefer to learn by watching (while listening. The function INTCK ('MONTH','1feb1991'd,'31jan1991'd) returns –1 because the first date is in a later discrete interval than the second date. The INTNX function returning ampere SAS date that is a specifications number of time units away from a specified date. notedate :$11. 47 months. . Graphing Your CAS Output. You can define a method to calculate differences. data new_data; set original_data; new_value1 = round (value, . January 2, 2017 to January 30, 2017 ==> INTCK returns 0, since there are no "1st of the month" dates within the interval. Ask Question Asked 3 years, 2 months ago. LOB ,MMD. These two functions complement each other: INTCK computes the difference between two dates, while. In those cases, the floor function may be removed to obtain the following formula:In general, ROUND (argument, rounding-unit) produces the result that you expect from decimal arithmetic if the result has no more than nine significant digits and any of the following conditions are true: The rounding unit is an integer. If you want today's year you can use the date () function (or its alias today ()) and then use the year () function to extract the year. In this case, my preferred solution would involve using an R version of SAS' INTCK function to do dates arithmetic in a more sophisticated way than described in my original example. Probably functions requiring multiple variables from different data sets cause bottlenecks. I'm trying to recreate a SURV_MM variable in the gold-standard dataset. g. on the hour), but rather the boundary. INTNX (timeUnit, startDate, numberOfUnits) This form of the INTNX function returns the first day of the specified time unit. df["diff"] = np. A string containing a formatted date representation cannot be implicitly evaluated to a SAS number, it would have to pass through input . WEEK_NUM AS SELECT DISTINCT MUC. Getting Started. Thus, at this article you will find few. You can fix this by using the CONTINUOUS method in INTCK. is a character constant or variable that contains an interval name. Here are some real-world examples of how the INTCK function is used in SAS. so I included that code also. difference=datetime1-datetime2; format difference time8. The function INTCK ('MONTH','31jan1991'd,'1feb1991’d) returns 1, because the two dates lie in different months that are one month apart. If you only want to get the difference, irrespective of the order, use the ABS function around the INTCK. Example of Continuous INTCK Function: 10 %put %sysfunc(intck('month',1,2)); WARNING: An argument to the function INTCK referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range. The following SAS program creates a temporary SAS data set called createdates that contains six date variables. Can you please help suggesting what I'm doing wrong? The output dataset is blank because intck function isn't working properly. You may have wanted to use the intnx () function instead, which returns a date (or datetime) from a date and an interval. Re: Nested SYSEVALF Errors in Macro. I am using the intck function to calculate it with the 4th arguement (method = 'C') but I think the 4th argument just works in case of years. INTCK and dates with DEC 31. The following functions can assist with the conversion between ANSI and SAS: TO_DOUBLE—converts any ANSI date, time, or timestamp. "as is" without warranty of any kind, either express. . Third you need to know the date format that will be used by the parameters. format. Note: The INTCK function returns the integer number of time intervals in a given time span. I know how to do it and you can see the code below. workdays); From there, all you have left to do is something like this: data dateCalculations; set mydata; numOfDays = intck ("workdays", theDate, today ()); run; SAS will take care of counting the number of dates (lines in the workdays. This means that YRS would have been 29 for any DOB in 1975 as well as for any second date in 2004. This was not a stated requirement of the original problem. Basically, l am calculating the number of days from the 10th of each month to the 10 of the next month, where weekdays plus saturdays are considered as. PROC SQL; CREATE TABLE historical AS. The form of the INTCK function is. . ; If the difference might be more than 99 hours then use a wider format, TIME12. I am still not sure I understand what your looking to produce in the query. . Re: Why Is INTCK Slower Than INTNX in SQL? intnxintckintnx was faster than intck. The INTNX function returns the SAS date value for the. Question eg: INTCK('QTR',FIN_YR,CNT_DATE)+5 What would provide me with the same answer in a SQL-Netzza code. ),input (booked_to,time5. You provide the start time, the end time, and the desired interval, and the INTCK function returns the difference in seconds, minutes, or hours. So you you need to reference the parameter value as &START_DATE, etc. . The form of the function is as follows: INTCK(‘<measured duration>’ , <DATEA>, <DATEB>); For example, if you wanted to measure the days that occurred between variable DATEA and DATEB, the. Example 3: Use INTNX to Find First Day of Month. This is my code. ; datalines; 188 18Jul17:15:27:00 97 188. You can use this function to calculate the number of days, weeks, months. When you use date and time intervals (for example, with the INTCK or INTNX functions), SAS bases its calculations on the calendar divisions that are present. Second you can use the %SYSFUNC() macro function to call the INTCK() function in macro code. For help clarifying this question so that it can be reopened, visit the help center . That is a very confusing way to write a data step. Glad to be able to help 🙂 When calling DATA step function from MACRO using %SYSFUNC, the general rule is to always leave out the quotes. . 3. The form of the INTCK function is INTCK( interval, from, to) where: interval is a character constant or variable containing an interval name from is the starting date (for date intervals) or datetime value (for datetime intervals) toSo to use INTCK() you need to convert those quoted strings into actual date values. ». Therefore, the INTCK expression returns the number of month boundaries that areMost database store date values as Datetime, so first check how your date values from teradata are returned in SAS. it seems that the SAS intck function has a problem when calculating the difference between two dates within a month. RUN_DATE AS REPEAT_DATE,COUNT (A. Ah. For example, WEEK intervals are determined by the number ofThe INTNX (and its sister function for computing date differences, INTCK) are powerful tools for manipulating date and datetime values. The INTCK function returns one number of time units between two data. exclude public holidays and weekends. BKD_DT, 1, "B") - t1. There are three parts to translating: INTNX ("MONTH", t1. ) The following example shows how to determine the date of the start of the week. So we will be using EMP_DET Table in. So, although 22JUN2020 and 20JUL2020 belong to different months, the number of completed months between these. e. ; array holidays(6); do date. Posted 08-21-2018 08:17 AM (1803 views) | In reply to AMFR. What's New in the Base SAS 9. Difference between two dates in year is accomplished using INTCK function with ‘year’ as argument as shown below. . Difference Between two dates using INTCK function in SAS: difference between two dates in days, weeks, months & year in SAS. The. That aside, I would suggest looking into the package lubridate. Digital Transformation. I could program this out, but I am guessing there is probably a format or function I'm not aware of to accomplish the task. There is no interval named DAYS. For example, WEEK intervals are determined by the number of Sundays that begin between the from and the to, not by how many seven-day periods fall in between the from. They are 'DISCRETE' (the default) and 'CONTINUOUS' (or "D" and "C"). It rounds off to the complete year i. The INTCK function using the default discrete method counts the number of times the beginning of an interval is reached in moving from the first date to the second. This was just an example to help you understand what it means. POLICY_EFCTV_DT. 04 -3 26 0. For example, WEEK intervals are counted by Sundays rather than seven-day multiples from the from argument. ; input fname :$12. When dealing with months, it measures the number of "1st of the month" dates within the interval. data temp; x = '12345'; new_x = input (x,5. . This functioning uses the following basic syntax: INTCK(interval, start dating, end data, method) where: interval: Interval the calculate (day, week, hour, quarter, year, etc. You can also advance a date/time using the INTNX function. Im looking for a way in which I can derive the same results in Netezza if I had used the "intck" function in SAS. デフォルトのDISCRETEメソッドを使用するINTCK関数は、1番目の日付と2番目の日付の間に次の間隔の開始点が含まれる回数を数えます。. ); start date: The start date; end date: The end date; method: Whether to count. ; today = DATE (); days = today - birthday; age = floor (days / 365); DATALINES; 01 122275 02 010865 03 030586 . SAS® FedSQL Language Reference documentation. SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Re: INTCK to compute minutes between dates. DATETIME values are seconds. Stock markets report opening and closing stock prices on trading days - generally equivalent to the "weekday" interval. 3. I want to calculate the month between 01FEB2021 and 31JAN2022, but even with the continous option the result is 11 month. The INTCK function is used to obtain the number of time intervals between two dates. If you want to know how to add days, weeks, months, etc. SAS のINTCK関数を使用すると、SAS の 2 つの日付の差をすばやく計算できます。. 1, and not 0. It does the same as the Teradata EXTRACT function with the DAY keyword. It covers a wide range of base and advanced tutorials that will help you get started with SAS. time; run; ThanksView the latest Intel Corp. It is worth to note that INTCK gives the time intervals passed between two dates as per the calendar. ERROR: Unresolved reference to table/correlation name s_cases. ” Ron’s book reminds us that the “INTCK function counts how many times you cross a boundary going from the start date to the end date. . The INTCK() function can also count backwards: when end-of-period is a date prior to start-of-period, the INTCK() function will return a negative number. By using multipliers and shift indexes, you can create multiples of intervals and shift their starting point to construct more complex interval specifications. 677. In this SAS tutorial, we will show you how to learn SAS programming on your own. One of which best ways to understand the INTNX and INTCK functions and how they job is up see some easy examples. options intervalds= (BankingDays=BankDayDS); data BankDayDS (keep=BEGIN); start = '15DEC1998'D;WEEKDAY<daysW> in INTCK Function: The INTCK function in SAS returns the number of interval boundaries that lie between two SAS dates, times, or timestamp values. 3 is not an exact multiple of one tenth in binary. The variables current1 and current2 are assigned the current date using the date( )and today( ) functions. You can use the INTCK function in SAS to quickly calculate the difference between two dates in SAS. If you simply need to know that there is 1 month difference between the 31-May and the 01-Jun, then use the 'discrete' (default) parameter. Difference between SCAN and SUBSTR? SCAN extracts words within a value that is marked by delimiters. The string needs to be something the DATE informat can interpret. The increment is based on a starting date, time, or datetime value, and on the number of time intervals that you specify. couldn't tell if you needed to convert date_1 and date_2 from character to numeric (dates). data example; date1 = '18Mar2021'd; date2 = '02Jul2021'd; default = intck ('month',date1,date2); cont = intck ('month',date1,date2,'C'); run; Decide what you would expect to be the number of months between those two dates (think perhaps of date1 as a. SAS software treats the year 2000 like any other leap year. SAS/ETS® User's Guide documentation. Since we are discussing the WEEKDAY function already, let’s look at. If Date is numeric this will fail with your attempt: date>"&date1". From 12-25-08 to 12-25-09 is one year difference. The sample code on the Full Code tab illustrates how to determine the exact number of years, months, and days between two SAS date values. You can use sas function intck to find required interval. 3. The INTCK function counts intervals by using a fixed starting point for the interval as opposed to counting in multiples of the interval unit. . Or target location of 'B'. I want to find EXACT months between two dates in SAS. Assume I have 2 timestamp. Parameter 1 is the interval. ); put cc hex4. Looks like your time stamp values are numeric variables with datetime values. The Basics; DBCS Compatibility; The Basics. 3. len_in_mths = intck(‘month’,start_dt,end_dt,’c’); INTCK PARAMETERS What do the parameters for intck in the above example mean. You can use the INTCK function in SAS to quickly calculate the difference between two dates in SAS. I was using INTCK to do this. The following code illustrates the correct way to use intck and convert characters to numeric using an informat: data _NULL_; input Booked_from $ booked_to $; minutes=intck ('minutes',input (booked_from,time5. SAS provides date, time, and datetime intervals for counting different periods of elapsed time. . 03 -4 20 0. . calendar_days =intck (' dt day', date2, date1); calendar_days1 =intck ('day', date2, date1); week_days=intck. The INTCK function using the default discrete method counts the number of times the beginning of an interval is reached in moving from the first date to the second. SAS 区间函数 INTNX 和 INTCK. Interval – can be in minutes, seconds, hours,weeks, days, months,quarter and year Start_date and end_date are between two dates which we will be finding interval; So we will be using EMP_DET Table in our example. ; If you need to keep the original variable name of cc , but as a character variable, then use the DROP. The ROUNDZ function returns a multiple of the rounding unit without trying to make the result match. Hello. To add 7 days to a date just add 7. . Please advise. In other words, it returns the date value for 30APR1796. The function INTCK ('MONTH', '31jan2013'd, '1feb2013’d) returns 1, because the two dates lie in different months that are one month apart. (INTCK returns a negative value whenever the first date is later than the second date and the two dates are not in. CAS Action Programming with CASL, Lua, and Python. . Dictionary of Language Elements. No other values for basis are valid when computing a person’s age. value_dt) < today ();. . The INTNX () function is used to loop through dates based on an offset. Person Day 1 Release Date Sales Person Day 2 Release Date Sales. For example, the following statements give dates relative to the bombing of Pearl. You need to specify dates, not datetimes. Total_days = intck ('dtday',begin_date,end_date); may be what you are looking for. The INTCK function counts the number of interval boundaries between two dates or between two datetime values. SAS stores datatime values in seconds. This question is probably better suited for StackOverflow, as it is about programming not statistics. Timestamp ('2019-12-31') curmth=1 print (mydate1,mydate2,cumth) 2019-07-15 00:00:00 2019-12-31 00:00:00 1 # INTNX function; pd. Besides the INTCK function, we. For more information on the INTCK and INTNX functions, see INTCK and INTNX: Two essential functions for computing intervals between dates in SAS, an article by @Rick_SAS. SAS Interface to Application Response Measurement (ARM) Security. 03 -5 15 0. What this means is that INTNX checks for intervals whereas INTCK is useful for computing a date/datetime value on the basis of a different date/datetime value. dob, doe); RUN; Right now if I had the date Oct 1, 2007 and Nov 15, 2011 it gives me 49 months I want it to give me 49. What's the best way. ”We would like to show you a description here but the site won’t allow us. INTCK - INT= Interval CK= Check. Crossing a 'month boundary' does not necessarily mean that a completed month has elapsed so a correction needs to be made when the end date (somedate) is less than the. time_Final; Diff = INTCK('second',Time_task_opened,Time_task_completed); set Mylib. 000 diff1=2,962. vectorize(intck_month)(df["obs"], df["out"]) Runtime. Otherwise, fairly self-explanatory! Let's take a look at an example. 1. The subjects each have a start and end date that is different. AGE=INT((INTCK('MONTH',DOB,refDate) - (DAY(refDate)<DAY(DOB)))/12); I stopped using it when I discovered that the calculation would sometimes produce odd results. What I have studied is that intnx function calculates the time interval b/w two date/time value but it also include that two date/time. ; format TS datetime20. So what I would do is first decide if you would k=like to count the first day. You can use the following methods to round numbers in SAS: Method 1: Round to Nearest Integer. Calculation of individual's age : The INTCK function is used to calculate the number of years between date of birth and today's date. Let's run a little test. The INTCK function in SAS is used to calculate the number of intervals between two dates or times. please try the below code which will output only the expected records, i wrote in datastep. We can use the INTNX function to create a new column called firstmonth that contains the first day of the month for each date in the date column: /*create new dataset with column that contains first day of the month*/ data new_data; set original_data; firstmonth=intnx('month', date, 0); format. (INTCK returns a negative value whenever the first date is. You can see the output in the attached pic. (c -continuous) INTCK METHOD Methods used are:The YEAR function produces a four-digit numeric value that represents the year. 1. . The month interval is specified in this implementation: INTCK('month',dob,eventdate) . It easy to play with the dates using INTNX. There are -3 days between Temp and Date2, hence Days_Shift = -3. Divide 21 by 31 days will give you . This function uses the following basic syntax: INTCK(interval, start date, end data, method) where: interval: Interval to calculation (day, week, month, quarter, year, etc. The INPUT Function is used to convert character variable to numeric. diff=intck("WEEKDAY", calc_start_date,end_date); run; The correct answer is 27 but l get 24. . Any clue? Thanks! data b; WeddingDay='14FEB2000'd; Today='28MAR2000'd; daysMarried=INTCK ('day',WeddingDay,today ()); format WeddingDay Today date9. The INTCK Function is second to calculate the difference amidst two dates and times. Then try the intck function for the difference. Desired result is the SURV_MM and N_MONTH is what I ended up with INTCK function as coded below. INTCK: week 2 01aug60. sas. B) Using DATEDIFF() function with table column example. 24619: Determine the week number of the year. 3 in decimal arithmetic. BAN) AS COUNT, CASE WHEN COUNT (A. The form of the INTCK function is . These two functions complement each other: INTCK computes the difference between two dates, while INTNX enables you to add time units to a date value. SAS provides date, time, and datetime intervals for counting different periods of elapsed time. Make your decision as to what you need to do! Also, here are some additional resources that may be helpful if you want to truly understand what is going on underneath the hood. Now I want to create a new variable such that it is the first day of the corresponding month. I ran a datastep with INTCK to create the var Minutes (between Start and End). And it's pretty darned close. Here we want to calculate when an employee. sas. (To convert the SAS date value to a calendar date, use any valid SAS date format, such as the DATE9. cchex=put (cc,hex4. SAS® 9. INTCK measure the number of boundaries crossed. Hi, i have a large data set that has details of when a client first made a deposit and the last date of deposit. PROC SQL; CREATE TABLE myTable AS SELECT BIRTH_DATE, <some function> AS DAYS_BETWEEN_BIRTHDATE_AND_TODAY FROM someTable. 2, a fifth argument to the INTCK function was added which will also help calculate a person's age. Using the INTNX and INTCK functions to determine the week number of each week in the month. Partial intervals are not counted. (c -continuous) INTCK METHOD Methods used are:The YEAR function produces a four-digit numeric value that represents the year. The days are numbered as Sunday(1) . The INTCK() function can also count backwards: when end-of-period is a date prior to start-of-period, the INTCK() function will return a negative number. ; * use 12. Whether you're a beginner or an advanced user, this tutorial offers a hands-on approach. documentation. Difference between two dates in year in SAS – Method 1: complete year – rounding off year. 1. proc sql; CREATE TABLE SASAVE. In this post, we discuss ways for exchanging data between SAS and Databricks Lakehouse Platform and ways to speed up the data flow. 1); /*round to 1 decimal place*/ new_value2 = round (value,. The function INTCK ('MONTH', '1feb2021'd, '31jan2021'd) returns –1 because the first date is in a later discrete interval than the second date. Data Mylib. DATA Step Programming. You need to apply a format to the date value so it displays properly. Your then filtering based on anndats, only selecting records where b anndats value is less than a anndats or b. . Sorted by: 4. SUBSTR extracts a portion of the value by stating. x=intnx ('week', '17oct03'd, 6); put x date9. from. » SAS : INTCK Function with Samples.