Which SAS function would be appropriate for finding out which day of the week a date falls on?

Master the SAS Base Programming Certification Exam with our comprehensive study tool. Utilize flashcards and multiple choice questions with detailed explanations. Gear up for success on your exam!

The WEEKDAY() function is designed specifically to determine the day of the week that corresponds to a given date in SAS. This function returns a numeric value where each number corresponds to a specific day, with 1 typically representing Sunday, 2 representing Monday, and so on through to 7 for Saturday. This makes it straightforward to use when you need to ascertain the specific day of the week from a date input.

In contrast, the MONTH() function is used to extract the month portion of a date, returning a value between 1 and 12. The DAY() function retrieves the day portion of a date, providing a number between 1 and 31, depending on the date. The INTNX() function is utilized to compute a date that is a specified number of intervals away from a given date but does not directly indicate which day of the week a date falls on. Therefore, WEEKDAY() is the most suitable option for determining the day of the week.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy