Chapter Contents |
Previous |
Next |
INTNX |
Category: | Date and Time |
Syntax | |
Arguments | |
Examples | |
See Also |
Syntax |
INTNX('interval',start-from,increment<,'alignment'>) |
The value of the character constant or variable must be one of those listed in this table:
Date Intervals | Datetime Intervals | Time Intervals |
---|---|---|
DAY | DTDAY | HOUR |
WEEKDAY | DTWEEKDAY | MINUTE |
WEEK | DTWEEK | SECOND |
TENDAY | DTTENDAY | |
SEMIMONTH | DTSEMIMONTH | |
MONTH | DTMONTH | |
QTR | DTQTR | |
SEMIYEAR | DTSEMIYEAR | |
YEAR | DTYEAR |
Requirement: | The type of interval (date, datetime, or time) must match the type of value in start-from and increment. |
Alias: | B |
Alias: | M |
Alias: | E |
Default: | BEGINNING |
Examples |
SAS Statements | Results |
---|---|
yr=intnx('year','05feb94'd,3); put yr / yr date7.; |
13515 01JAN97 |
x=intnx('month','05jan95'd,0); put x / x date7.; |
12784 01JAN95 |
next=intnx('semiyear','01jan97'd,1); put next / next date7.; |
13696 01JUL97 |
past=intnx('month2','01aug96'd,-1); put past / past date7; |
13270 01MAY96 |
sm=intnx('semimonth2.2', '01apr97'd,4); put sm / sm date7.; |
13711 6JUL97 |
These examples illustrate advancing a date using an alignment value:
SAS Statements | Results |
---|---|
date1=intnx('month','01jan95'd,5, 'beginning'); put date1 / date1 date7.; |
12935 01JUN95 |
date2=intnx('month','01jan95'd,5, 'middle'); put date2 / date2 date7.; |
12949 5JUN95 |
date3=intnx('month','01jan95'd,5, 'end'); put date3 / date3 date7.; |
12964 30JUN95 |
See Also |
Function:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.