About This Book
Purpose
This book is designed to provide a detailed look at how the SAS date facility works, including an in-depth look at intervals and the interval functions, ISO 8601 date and datetime handling, and the NLS formats and informats. It is intended to serve as both a reference and a teaching tool. Ultimately, this book will allow the reader to become more confident in their daily work with dates, times, and datetimes in SAS.
Is This Book for You?
This book is aimed at beginning to intermediate SAS programmers, or those who work with ISO 8601 data, intervals, and/or reporting in multiple languages.
Whats New in This Edition
This new edition includes updated information to reflect the changes in version 9 of SAS; an expanded discussion of intervals, including the ability to define your own intervals; a section on how SAS works with the ISO 8601 date standards; and a troubleshooting appendix for beginners.
Scope of This Book
This book does not cover the SAS/ETS product, except for an overview of the EXPAND procedure.
About the Examples
Software Used to Develop the Book's Content
SAS version 9.4 (TS level 1M0) was used to produce all the examples in this book.
Example Code and Data
Many of the examples used in this book have accompanying code and data.
You can access the example code and data for this book by linking to its author page at http://support.sas.com/publishing/authors. Select the name of the author. Then, look for the cover thumbnail of this book, and select Example Code and Data to display the SAS programs that are included in this book.
For an alphabetical listing of all books for which example code and data is available, see http://support.sas.com/bookcode. Select a title to display the books example code.
If you are unable to access the code through the website, send e-mail to .
Output and Graphics Used in This Book
Tables in this book were generated using ODS RTF, while graphics were generated as PNG files directly in SAS using the GPLOT and SGPLOT procedures. Screen captures were used to show the VIEWTABLE displays.
Additional Help
Although this book illustrates many analyses regularly performed in businesses across industries, questions specific to your aims and issues may arise. To fully support you, SAS Institute and SAS Press offer you the following help resources:
For questions about topics covered in this book, contact the author through SAS Press:
Send questions by email to ; include the book title in your correspondence.
Submit feedback on the authors page at http://support.sas.com/author_feedback.
For questions about topics in or beyond the scope of this book, post queries to the relevant SAS Support Communities at https://communities.sas.com/welcome.
SAS Institute maintains a comprehensive website with up-to-date information. One page that is particularly useful to both the novice and the seasoned SAS user is its Knowledge Base. Search for relevant notes in the Samples and SAS Notes section of the Knowledge Base at http://support.sas.com/resources.
Registered SAS users or their organizations can access SAS Customer Support at http://support.sas.com. Here you can pose specific questions to SAS Customer Support; under Support, click Submit a Problem. You will need to provide an email address to which replies can be sent, identify your organization, and provide a customer site number or license information. This information can be found in your SAS logs.
Meet the Author
Derek Morgan is a senior SAS programmer in the pharmaceutical industry who has been programming professionally in SAS for over 27 years. He spent 23 of those years at Washington University in St. Louis, where he received an A.B. in biology in 1985 and his first introduction to SAS as a student. During his career he has used SAS to create interactive data entry and management systems and to build and maintain research databases for analysis. In the late 1980s, he created a macro library to allow the use of nonproportional fonts in tables and listings on PostScript printers. He has taught introductory SAS programming and has presented many papers at local, regional, and national SAS Users Group conferences. Derek is married and has one son, and in his spare time he plays electric bass around the St. Louis area.
Learn more about this author by visiting his author page at http://support.sas.com/publishing/authors/morgan.html. There you can download free book excerpts, access example code and data, read the latest reviews, get updates, and more.
Keep in Touch
We look forward to hearing from you. We invite questions, comments, and concerns. If you want to contact us about a specific book, please include the book title in your correspondence.
Contact the Author through SAS Press
By e-mail:
Via the Web: http://support.sas.com/author_feedback
Purchase SAS Books
For a complete list of books available through SAS, visit sas.com/store/books.
Phone: 1-800-727-0025
E-mail: sasbook@sas.com
Subscribe to the SAS Training and Book Report
Receive up-to-date information about SAS training, certification, and publications via email by subscribing to the SAS Training & Book Report monthly eNewsletter. Read the archives and subscribe today at http://support.sas.com/community/newsletters/training!
Publish with SAS
SAS is recruiting authors! Are you interested in writing a book? Visit http://support.sas.com/saspress for more information.
Acknowledgments
A book is always a team effort, and I can honestly say that I have had a great one. Starting with the people at SAS Press whose efforts and patience on my behalf have resulted in this second edition, I would like to thank Julie Platt, Shelley Sessoms, and Stacey Hamilton but most especially my developmental editor, Stephenie Joyner, who kept me on task and moving forward. SAS guru Art Carpenter has been more than just an editor; he has been a mentor, and every time I run into him, I find myself knowing how to do something better than I did before. This second edition would not exist without his support. Another big thank you goes to Denise T. Jones, Stacy Suggs, and Robert Harris, all from SAS Press, who are responsible for producing this book from my manuscript.
Thanks to Andrew Karp for introducing me to the world of PROC EXPAND, and to Mike Forno of SAS Institute for answering my questions on it. I greatly appreciate the American Public Transportation Association (http://www.apta.com), which allowed me to use data compiled from its member transit agencies for the PROC EXPAND examples. The technical support group at SAS Institute deserves special mention; after 27 years of working as a computer programmer, I have come to the conclusion that you are, without a doubt, the best in the business. Thank you for all of your help throughout my SAS career.
Id also like to thank the technical reviewers from SAS InstituteRichard Bell, Chris DeHart, Johnny Johnson, Rick Langston, and Kim Wilsonfor their thoughtful comments and corrections. In addition, Paul Rowland deserves a big thank you for his willingness to provide a SAS users perspective.
Ultimately, this project would not have been possible without the support of my family, past and present. To my son, Terec, thank you for understanding my distraction during Formula I season, and thank you for the photo. To my wife, Billie, thank you for letting me work on our weekends and a good number of our evenings, and for contributing your knowledge of Microsoft Word to help me write the manuscript.