SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Search||next

Transforming Data with SAS Functions
Manipulating SAS Date Values with Functions


MONTH Function

The MONTH function enables you to extract the month value from a SAS date value.


General form, MONTH function:
MONTH(date)

where date is a SAS date value that is specified as a variable or a SAS date constant. For more information about SAS date constants, refer to SAS Language Reference: Dictionary.


The value returned by the MONTH function is a numeric value that ranges from 1 to 12. It represents the month of the year. The value 1 represents January, 2 represents February, and so on. The MONTH function is very similar to the DAY and YEAR functions in purpose and form.


Function Description Form Sample Value
MONTH Extracts the month value from a SAS date value. MONTH(date) 12
DAY Extracts the day value from a SAS date value. DAY(date) 5
YEAR Extracts the year value from a SAS date value. YEAR(date) 2002



  |next


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

Terms of Use & Legal Information | Privacy Statement