

Returns an interval that fits three consecutive SAS date or datetime values. INTGET( date1, date2, date3 ) INTGET( datetime1, datetime2, datetime3 ) The valid values of size ('long,' 'l,' 'short,' 's') specify whether the returned format uses a two-digit or four-digit year to display the SAS date value.
Sas date calculator series#
Returns a recommended format, given a date, time, or datetime interval for displaying the time ID values associated with a time series of the given interval. The INTFIT function can be used to detect the possible frequency of the time series or to analyze frequencies of other events in a time series, such as outliers or missing values. The INTFIT algorithm chooses the more common interval, so 'WEEK' is the result when the dates are seven days apart. For instance, two SAS date values that are seven days apart could be fit with either 'DAY7' or 'WEEK'. More than one interval can fit the preceding definition. Result2 = INTNX( FitInterval, date1, 1, 'SAMEDAY') Result1 = INTNX( FitInterval, date1, 0, 'SAMEDAY') In the following example, result1 is the same as date1 and result2 is the same as date2.įitInterval = INTFIT( date1, date2, 'D' ) Returns an interval that fits exactly between two SAS date, datetime, or observation values, in the sense of the INTNX function uses SAMEDAY alignment. INTFIT( date1, date2, ' D' ) INTFIT( datetime1, datetime2, ' DT' ) INTFIT( obs1, obs2, ' OBS' ) INTCYCLE('DAY') returns 'WEEK' since Sunday, Monday. For example, INTCYCLE('MONTH') returns 'YEAR' since the months January, February. Returns the interval of the seasonal cycle, given a date, time, or datetime interval. Returns the number of boundaries of intervals of the given kind that lie between the two date or datetime values.

INTCK( ' date-interval', date1, date2 ) INTCK( ' datetime-interval', datetime1, datetime2 ) For correct results, date intervals should be used with date values, and datetime intervals should be used with datetime values. For example, the seasonal cycle for INTERVAL='DAY' is 'WEEK', so INTCINDEX(’DAY’,’01SEP78’D) returns 35 since September 1, 1978, is the sixth day of the th week of the year. Returns the index of the seasonal cycle given an interval and an appropriate SAS date, datetime, or time value.

INTCINDEX( ' date-interval', date ) INTCINDEX( ' datetime-interval', datetime ) Returns the hour from a SAS datetime or time value. For example: EASTER2000 = HOLIDAY(’EASTER’, 2000) HOUR( datetime ) Valid values for holiday are 'BOXING', 'CANADA', 'CANADAOBSERVED', 'CHRISTMAS', 'COLUMBUS', 'EASTER', 'FATHERS', 'HALLOWEEN', 'LABOR', 'MLK', 'MEMORIAL', 'MOTHERS', 'NEWYEAR','THANKSGIVING', 'THANKSGIVINGCANADA', 'USINDEPENDENCE', 'USPRESIDENTS', 'VALENTINES', 'VETERANS', 'VETERANSUSG', 'VETERANSUSPS', and 'VICTORIA'.

Returns a SAS date value for the holiday and year specified. Returns a SAS time value for hour, minute, and second values. Returns a SAS datetime value for date, hour, minute, and second values. Returns the day of the month from a SAS date value. Returns the current date and time of day as a SAS datetime value. Returns the date part of a SAS datetime value as a date value. For example, DATE = DATEJUL(99001) assigns the SAS date value '01JAN99'D to DATE, and DATE = DATEJUL(1999365) assigns the SAS date value '31DEC1999'D to DATE. Returns the SAS date value given the Julian date in yyddd or yyyyddd format. Returns today’s date as a SAS date value.
