Skip to Main Content
An Introduction to SAS University Edition
book

An Introduction to SAS University Edition

by Ron Cody
February 2018
Beginner content levelBeginner
366 pages
7h 2m
English
SAS Institute
Content preview from An Introduction to SAS University Edition

Chapter 13: Working with SAS Dates

Introduction

Reading Dates from Text Data

Creating a SAS Date from Month, Day, and Year Values

Describing a Date Constant

Extracting the Day of the Week, Day of the Month, and Year from a SAS Date

Adding a Format to the Bar Chart

Computing Age from Date of Birth: The YRDIF Function

Conclusion

Problems

Introduction

SAS can read and write dates in almost any format, such as 5/23/2015 or 23May2015. No matter how the date appears in the input file, SAS converts all dates to the number of days from January 1, 1960. Thus, January 1, 1960, is 0; January 2, 1960, is a 1; and so on. Dates before January 1, 1960, are converted to negative numbers. For example, December 31, 1959, is equal to -1. Almost all computer languages ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential Statistics Using SAS University Edition

Essential Statistics Using SAS University Edition

Geoff Der, Brian S. Everitt
Elementary Statistics Using SAS

Elementary Statistics Using SAS

Sandra D. Schlotzhauer

Publisher Resources

ISBN: 9781629600079