Chapter Contents

Previous

Next
VMSZNw.d

VMSZNw.d



Generates a string of ASCII digits

Language element: format
Category: numeric
Width range: 1 to 32
Default width: 1
Alignment: left
OpenVMS specifics: All aspects are host-specific


Syntax
Details
Examples
Example 1: Using the VMSZNw.d Format in a SAS Statement
Example 2: Zoned-Numeric Representations
See Also

Syntax

VMSZNw.d

w
specifies the width of the output field

d
optionally specifies the number of digits to the right of the decimal point in the numeric value.


Details

The VMSZNw.d format is similar to the ZDw.d format. Both generate a string of ASCII digits, and the last digit is a special character that denotes the magnitude of the last digit and the sign of the entire number. The difference between these formats is in the special character that is used for the last digit. The following table shows the special characters that are used by the VMSZNw.d format.

Desired
Digit
Special
Character
Desired
Digit
Special
Character
0 0 -0 p
1 1 -1 q
2 2 -2 r
3 3 -3 s
4 4 -4 t
5 5 -5 u
6 6 -6 v
7 7 -7 w
8 8 -8 x
9 9 -9 y

Data formatted using the VMSZNw.d format are ASCII strings.

If the value to be formatted is too large to fit in a field of the specified width, then the VMSZNw.d format does the following:


Examples

Example 1: Using the VMSZNw.d Format in a SAS Statement

If you format the value 1234 using the VMSZNw.d format in the following SAS statement:

put i vmszn4.;
the result is 1234, which is an ASCII string.

If you format the value 1234 using the VMSZNw.d format in the following SAS statement:

put i vmszn5.1;
the result is 12340, which is an ASCII string.

If you format the value 1234 using the VMSZNw.d format in the following SAS statement:

put i vmszn6.2;
the result is 123400, which is an ASCII string.

If you format the value -1234 using the VMSZNw.d format in the following SAS statement:

put i vmszn5.;
the result is 123t, which is an ASCII string.


Example 2: Zoned-Numeric Representations

If you format the value 300 using the VMSZNw.d format, you receive the following value:

'9'
which is an ASCII string.

If you format the value -300 using the VMSZNw.d format, you receive the following value:

'y'
which is an ASCII string that is the zoned-numeric representation of -9.

See Also


Chapter Contents

Previous

Next

Top of Page

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