Chapter Contents

Previous

Next
SHRSTAMPw.

SHRSTAMPw.



Reads date and time values of SHR records

Category: Date and Time


Syntax
Syntax Description
Details
Examples

Syntax

SHRSTAMPw.

Syntax Description

w
specifies the width of the input field.
Requirement: w must be 8 because packed decimal date and time values in SHR records contain eight bytes of information: four bytes of date data that are followed by four bytes of time data.


Details

The SHRSTAMPw. informat reads packed decimal date and time values of SHR records that are produced by IBM mainframe environments and converts the date and time values to SAS datetime values.

The general form of the date and time information in an SHR record in hexadecimal notation is yyyydddFhhmmssth, where

yyyy
is the two-bytes representation of four digits that correspond to the year.

ddd
is the one-and-a-half bytes that contain three digits that correspond to the day of the year.

F
is the half byte that contains all binary 1s.

hh
is the one-byte representation of two digits that correspond to the hour of the day.

mm
is the one-byte representation of two digits that correspond to minutes.

ss
is the one-byte representation of two digits that correspond to seconds.

th
is the one-byte representation of two digits that correspond to a hundredth of a second.

The SHRSTAMPw. informat enables you to read, on any operation environment, packed decimal date and time values from files that are created on an IBM mainframe.


Examples

input begin shrstamp8.;

Data Lines* Results
----+----1----+----2

0097239F12403576
1188304835.8
*The data line is a hexadecimal representation of a packed decimal date and time value that is stored as it would appear in an SHR record. Each byte occupies one column of the input field. The result is a SAS datetime value that corresponds to Aug. 27, 1997 12:40:36 PM.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.