*Copyright @ www.mycsg.in;


Date Functions in SAS

Function Definition
TODAY The TODAY function returns the current date as a SAS date value.
DATEPART The DATEPART function extracts the date portion from a datetime value and returns it as a SAS date value.
YEAR The YEAR function extracts the year from a SAS date value.
MONTH The MONTH function extracts the month from a SAS date value.
DAY The DAY function extracts the day of the month from a SAS date value.
MDY The MDY function creates a SAS date value from the given month, day, and year values.
INTCK The INTCK function calculates the number of intervals (e.g., days, months, years) between two dates.
INTNX The INTNX function increments a date value by a specified number of intervals (e.g., days, months, years).

Create sample data

Examples for TODAY Function

Examples for DATEPART Function

Examples for YEAR, MONTH, and DAY Functions

Examples for MDY Function

Examples for INTCK Function

Examples for INTNX Function