0% found this document useful (0 votes)
2 views

Common Date Functions for Creating Columns_Lesson3

The document outlines common SAS date functions used for creating and manipulating date columns. Key functions include MONTH, YEAR, DAY, WEEKDAY, QTR, TODAY, MDY, and YRDIF, each serving specific purposes such as extracting date components or calculating age. These functions facilitate the generation of SAS date values from provided arguments.

Uploaded by

ashish99998
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Common Date Functions for Creating Columns_Lesson3

The document outlines common SAS date functions used for creating and manipulating date columns. Key functions include MONTH, YEAR, DAY, WEEKDAY, QTR, TODAY, MDY, and YRDIF, each serving specific purposes such as extracting date components or calculating age. These functions facilitate the generation of SAS date values from provided arguments.

Uploaded by

ashish99998
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Common Date Functions for Creating Columns 8/15/19, 5(16 PM

Print

Common Date Functions for Creating Columns


SAS date functions are incredibly helpful for creating and manipulating SAS dates.

These functions extract information from the SAS date column or value provided in the argument:

Date Function What it Does


MONTH (SAS-date) Returns a number from 1 through 12 that represents the month
YEAR (SAS-date) Returns the four-digit year
DAY (SAS-date) Returns a number from 1 through 31 that represents the day of the month
WEEKDAY (SAS-date) Returns a number from 1 through 7 that represents the day of the week
(Sunday=1)
QTR (SAS-date) Returns a number from 1 through 4 that represents the quarter

These functions enable you to create SAS date values from the arguments.

Date Function What it Does


TODAY () Returns the current date as a numeric SAS date value (no
argument is required because the function reads the system
clock)
MDY (month, day, year) Returns a SAS date value from numeric month, day, and year
values
YRDIF (startdate, enddate, 'AGE') Calculates a precise age between two dates

Type and save a note for this page.

Submit

SAS® Programming 1: Essentials


Copyright © 2019 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Close

https://vle.sas.com/pluginfile.php/257532/mod_scorm/content/258/rc_common/tt_printversionEmbed.htm Page 1 of 1

You might also like