SET PCTFORMAT: Displaying a Percent Sign for Percent Prefix Operators

The SET PCTFORMAT command controls whether fields prefixed with the operators PCT., RPCT., and PCT.CNT. display with a percent sign or with the format associated with the original field.

The syntax is:

SET PCTFORMAT = {OLD|PERCENT}

where:

OLD

Displays columns prefixed with PCT., RPCT., and PCT.CNT. with the format associated with the original field.

PERCENT

Displays columns prefixed with PCT., RPCT., and PCT.CNT. with a percent sign. It also allows the prefixed fields to be reformatted. This is the default value.

PCT.CNT.field will always display with two decimal places, unless reformatted. For PCT.field and RPCT.field, with SET PCTFORMAT = PERCENT, if the original field has a:

Example: Displaying Columns for Fields Prefixed With PCT., RPCT., and PCT.CNT.

The following request displays columns that use the prefix operators PCT. and PCT.CNT against fields formatted to show currency symbols. The value of the PCTFORMAT parameter is set to OLD.

DEFINE FILE GGSALES
DOLL1/D12.4M = DOLLARS;
UNIT1/D12.6M = UNITS;
DOLL2/P12.4M = DOLLARS;
UNIT2/I7M = UNITS;
END
TABLE FILE GGSALES
SUM DOLLARS UNITS PCT.UNIT2 PCT.DOLL1 PCT.DOLL2 PCT.CNT.UNIT1
BY CATEGORY
ON TABLE SET PCTFORMAT OLD
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END

The output is shown in the following image. The columns that display prefixed fields, except for the one using the PCT.CNT. prefix, display currency symbols instead of percent signs because the formats of the original fields are used.

Changing SET PCTFORMAT to PERCENT produces the following output, in which the currency symbols have been removed and all prefixed columns display percent signs.

WebFOCUS

Feedback