Reads complete, truncated, and omitted forms of ISO 8601 duration,
datetime, and interval values that are specified in either the basic or extended
notations.
Category: |
Date and Time
|
|
ISO
8601
|
Alignment: |
left
|
Time Zone Informat: |
No
|
ISO 8601 Element: |
5.4.4 Complete representation
|
- w
-
specifies the width of the input 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 decimal
point in the seconds value. This argument is optional.
The $N8601B informat reads ISO 8601 duration, datetime,
and interval values as character data for the following basic notations:
Time Component |
ISO 8601 Notation |
Example |
Duration |
Pyyyy-mm-ddThh:mm:ss.fff |
P2008-09-15T15:53:00 |
|
PyyyymmddThhmmss |
P00020304T050607 |
|
PnYnMnDTnHnMn.fffS |
P2y10m14dT20h13m45.222s |
|
PnW |
P6w |
Interval |
yyyy-mm-ddThh:mm:ss.fff/yyyy-mm-ddThh:mm:ss.fff |
2008-09-15T15:53:00/2010-11-13T00:00:00 |
|
yyyymmddThhmmss.fff/yyyymmddThhmmss.fff |
20080915T155300/20101115T120000 |
|
PnYnMnDTnHnMn.fffS/yyyy-mm-ddThh:mm:ss.fff |
P2y10M14dT20h13m45s/2008-09-15T15:53:00 |
|
yyyy-mm-ddThh:mm:ss.fff/PnYnMnDTnHnMn.fffS |
2008-09-15T15:53:00/P2y10M14dT20h13m45s |
Datetime |
yyyy-mm-ddThh:mm:ss.fff |
2008-09-15T15:53:00 |
|
yyyymmddThhmmss.fff
|
20080915T155300 |
The $N8601B informat also reads ISO 8601 duration, interval, and
datetime
components that contain omitted components or truncated components. Omitted
components must use a single hyphen ( - ) to represent the component.
The $N8601B informat reads durations, intervals, and datetimes
that are specified in either the basic or extended notation. The $N8601E informat
reads valid durations, intervals, and datetimes that are specified only in
the extended notation. Use the $N8601E informat when you need to ensure compliance
with the extended notation.
input @1 i860 $n8601b.;
Data Line |
Results |
p0002-04-05t5:1:12
|
0002405050112FFC
|
2008-09-15T15:53:00/2010-09-15T00:00:00
|
2008915155300FFD2010915000000FFD
|
p0033-01-04T3:2:55/2008-09-15T15:53:00
|
0033104030255FFC2008915155300FFD
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.