Chapter Contents

Previous

Next
ZDw.d

ZDw.d



Reads zoned decimal data

Language element: informat
Category: numeric
Width range: 1 to 32
Default width: 1
OpenVMS specifics: the last byte includes the sign


Syntax
Details
Examples
See Also

Syntax

ZDw.d

w
specifies the width of the input field.

d
optionally specifies the power of 10 by which to divide the input value. If you specify d, the ZDw.d informat divides the input value by the 10d value. If the data contain decimal points, then SAS ignores the d value.


Details

The ZDw.d informat accepts true zoned decimal, trailing numeric strings with the overpunch format; numeric strings of the form that is read by the standard numeric informat; and hybrid strings. A hybrid string is a zoned decimal string that has an explicit sign.

To achieve the same results as the Release 6.06 implementation of the ZDw.d informat, use the ZDVw.d informat.

A zoned decimal, or trailing numeric string with overpunch format, is a character string consisting of digits. The last character of the string is a special character that specifies both the value of the last digit and the sign of the entire number. The special characters are listed in the following table.

Digit ASCII
Character
Digit ASCII
Character
0 { -0 }
1 A -1 J
2 B -2 K
3 C -3 L
4 D -4 M
5 E -5 N
6 F -6 O
7 G -7 P
8 H -8 Q
9 I -9 R

The data formatted using the ZDw.d informat are ASCII strings.


Examples

If you format the ASCII string 123{ using ZDw.d informat in the following SAS statement:

input i zd4.;
the result is 1230.

If you format the ASCII string 123} using the ZDw.d informat in the following SAS statement:

input i zd4.;
the result is -1230.

If you format the ASCII string 1230 using the ZDw.d informat in the following SAS statement:

input i zd4.;
the result is 1230.

If you format the ASCII string -1230 using the ZDw.d informat in the following SAS statement:

input i zd5.;
the result is -1230.

If you format the ASCII string +123{ using the ZDw.d informat in the following SAS statement:

input i zd5.;
the result is 1230.

See Also


Chapter Contents

Previous

Next

Top of Page

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