GZ

From BR Wiki
Revision as of 15:08, 7 August 2013 by Laura (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The GZ (generic, zero suppression) format specification indicates that numeric values of zero are to be suppressed on output. GZ can be used with FORM statements for internal, external and display files, and it can be used with the full screen processing statements.

Input characteristics

When used for input, GZ is treated as G.

Output characteristics

When used for output of numeric data, GZ operates the same as NZ. If the value of a number is zero, blanks are output instead. If the value of a number is not zero, output is like N format. Printed values are right justified, padded with blanks on the left and rounded to the specified number of decimal points.

Output from the following example would be a blank line:

00010 PRINT USING 20: 0
00020 FORM GZ 4.2

GZ can efficiently take the place of simple PIC constructions. The following two lines are equivalent except that the first is shorter to code, it stores more efficiently and it executes more quickly:

00010 PRINT USING "FORM GZ 10.2,GZ 10": A,B
00020 PRINT USING "FORM PIC( - - --. -), PIC( - - - - -)": A,B

See Also

The letter G can also be used as a Control Attribute.