Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 6. SAS® Dates: Reading, Writing,... > Example 4: Extracting Day of Week an...

Example 4: Extracting Day of Week and Day of Month from a SAS Date

FEATURES:DAY and WEEKDAY Functions


The SAS System contains functions to compute day of the week and day of the month from a SAS date. It is easy to confuse the two. The DAY function returns a number from 1 to 31 which represents the day of the month corresponding to a given date; the WEEKDAY function returns a number from 1 to 7, corresponding to the day of the week. Suppose you want to chart the frequency of hospital admissions by day of the week and day of the month using the HOSP data from Example 1. Here is the program:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial