Introduction

SAS provides many informats for reading raw data values in various forms. If you completed the lesson , you worked with informats to read standard and nonstandard data. In this lesson, 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


Notice:

Setting Up Filerefs for Practices in This Lesson




1 hour



In this lesson, you learn how

  • SAS stores date and time values
  • to use SAS informats to read common date and time expressions
  • to handle two-digit date values
  • to calculate time intervals by subtracting two dates
  • to multiply a time interval by a rate
  • to display various date and time values.

complete the following lessons:

  • .