Writes ISO 8601 duration, datetime, and interval forms
PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss, dropping omitted
components in duration values and using a hyphen ( - ) for omitted components
in datetime values.
Category: |
Date and Time
|
|
ISO
8601
|
Alignment: |
left
|
Time Zone Format: |
No
|
ISO 8601 Element: |
5.5.3, 5.5.4.1, 5.5.4.2
|
- w
-
specifies the width of the output field.
Default: |
50 |
Range: |
1 - 200 |
Requirement: |
The minimum length for a duration
value or a datetime value is 16. The minimum length for an interval value
is 16. |
- d
-
specifies the number of digits to the right of the lowest
order component. This argument is optional.
The $N8601H format writes ISO 8601 durations, intervals,
and datetimes in the following forms, omitting components in the
PnYnMnDTnHnMnS
form and using a hyphen ( - ) to represent omitted components in the datetime
form:
|
PnYnMnDTnHnMnS |
|
yyyy-mm-ddThh:mm:ss |
|
PnYnMnDTnHnMnS/yyyy-mm-ddThh:mm:ss |
|
yyyy-mm-ddThh:mm:ssT/PnYnMnDTnHnMnS |
|
yyyy-mm-ddThh:mm:ss/yyyy-mm-ddThh:mm:ss |
Omitted
datetime components are always displayed, they are never truncated.
put nh $n8601h.;
Value of nh |
Results |
0002304FFFFFFFFC2008FFF15FFFFFFD
|
P2Y3M4D/2008----T15:-:-
|
FFFF102FFFFFFFFD2008FFF15FFFFFFD
|
--01-02T-:-:-0/2008----T15:-:-
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.