197k views
5 votes
Which of the following SAS functions returns a number from 1 to 12?

a. YEAR(SAS-date-value)
b. MONTH(SAS-date-value)
c. WEEKDAY(SAS-date-value)
d. none of the above

1 Answer

2 votes

Final answer:

The SAS function that returns a number from 1 to 12 representing the month is the MONTH(SAS-date-value). It extracts the month from a SAS date value, whereas other functions like YEAR and WEEKDAY return the year and the day of the week, respectively.

Step-by-step explanation:

The SAS function that returns a number from 1 to 12, corresponding to the months January to December, is b. MONTH(SAS-date-value). The MONTH function extracts the month part from a SAS date value. For example, if the SAS date value represents the date March 15, 2023, the MONTH function would return 3.

Whereas the YEAR function would return the year part from a date, and WEEKDAY returns a number representing the day of the week (1 for Sunday through 7 for Saturday).

User Xorifelse
by
7.8k points