Previous Page | Next Page

Informats under OpenVMS

ZDw.d Informat: OpenVMS



Reads zoned decimal data.
Category: numeric
Width range: 1 to 32
Default width: 1
OpenVMS specifics: the last byte includes the sign
See: ZDw.d Informat in SAS Language Reference: Dictionary

Syntax
Details
Examples
See Also

Syntax

ZDw.d

w

specifies the width of the input field.

d

specifies the power of 10 by which to divide the input value. This argument is optional. If you specify d, the ZDw.d informat divides the input value by the 10d value. If the data contains 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 SAS 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 input the ASCII string 123{ using ZDw.d informat in the following SAS statement:

input i zd4.;

the result is 1230.

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

input i zd4.;

the result is -1230.

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

input i zd4.;

the result is 1230.

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

input i zd5.;

the result is -1230.

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

input i zd5.;

the result is 1230.


See Also

Previous Page | Next Page | Top of Page