B8601LZw. Format

Writes time values as local time by appending a time zone offset difference between the local time and UTC, using the ISO 8601 basic time notation hhmmss+|–hhmm.
Categories: Date and Time

ISO 8601

Alignment: left
Supports: ISO 8601 Elements 5.3.3 and 5.3.4.2

Syntax

B8601LZw.

Syntax Description

w
specifies the width of the output field.
Default:14
Range:9–20

Details

The B8601LZ format writes time values without making any adjustments, and appends the UTC time zone offset for the local SAS session by using the ISO 8601 basic notation hhmmss+|–hhmm:
hh
is a two-digit hour (zero padded) between 00 and 23.
mm
is a two-digit minute (zero padded) between 00 and 59.
ss
is a two-digit second (zero padded) between 00 and 59.
+|–hhmm
is an hour and minute signed offset from zero meridian time. Note that the offset must be +|–hhmm (that is, + or – and four characters).
Use + for time zones east of the zero meridian, and use – for time zones west of the zero meridian. For example, +0200 indicates a two-hour time difference to the east of the zero meridian, and –0600 indicates a six-hour time difference to the west of the zero meridian.
Restriction: The shorter form +|–hh is not supported.
When SAS reads a UTC time by using the B8601TZ informat, and the adjusted time is greater than 24 hours or less than 00 hours, SAS adjusts the value so that the time is between 000000 and 235959. If the B8601LZ format attempts to format a time outside of this time range, the time is formatted with asterisks to indicate that the value is out of range.

Example

This PUT statement writes the time for the Eastern Standard time zone:
put blz b8601lz.;
Value of blz
Result
46380
125300-0500