Using Date and Time Formats

Overview

Remember that when Perm.Aprbills is printed, the values for DateIn and DateOut appear as SAS date values.
Raw data file Aprdata
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; 
>proc print data=perm.aprbills; 
run;
PROC PRINT Output for the above Example
PROC PRINT output for the above example.
SAS provides many specialized date and time formats that enable you to specify how ...

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.