Overview

Introduction

SAS provides many informats for reading raw data values in various forms. Reading Raw Data in Fixed Fields explained how informats can be used to read standard and nonstandard data. In this chapter, you learn how to use a special category of SAS informats called date and time informats. These informats enable you to read a variety of common date and time expressions. After you read date and time values, you can also perform calculations with them.
options yearcutoff=1920; 
data perm.aprbills; 
   infile aprdata; 
   input LastName $8. @10 DateIn mmddyy8. +1 DateOut 
      mmddyy8. +1 RoomRate 6. @35 EquipCost 6.; 
   Days=dateout-datein+1; 
   RoomCharge=days*roomrate; 
   Total=roomcharge+equipcost; 
run;
Program Data Vector

Objectives ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.