Chapter Contents

Previous

Next
Zw.d

Zw.d



Writes standard numeric data with leading 0s

Category: Numeric
Alignment: right


Syntax
Syntax Description
Details
Comparisons
Examples

Syntax

Zw.d

Syntax Description

w
specifies the width of the output field.
Default: 1
Range: 1-32
Tip: Allow enough space to write the value, the decimal point, and a minus sign, if necessary.

d
optionally specifies the number of digits to the right of the decimal point in the numeric value.
Range: 0-31
Tip: If d is 0 or you omit d, Zw.d writes the value without a decimal point.


Details

The Zw.d format writes standard numeric values one digit per byte and fills in 0s to the left of the data value.

The Zw.d format rounds to the nearest number that will fit in the output field. If w.d is too large to fit, SAS may shift the decimal to the BESTw. format. The Zw.d format writes negative numbers with leading minus signs. In addition, it right aligns before writing and pads the output with leading zeros.


Comparisons

The Zw.d format is similar to the w.d format except that Zw.d pads right-aligned output with 0s instead of blanks.


Examples

put @5 seqnum z8.;

Values Results

----+----1
1350
00001350


Chapter Contents

Previous

Next

Top of Page

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