Edit (QECEDT) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Receiver variable length Input Binary(4)
3 Source variable Input *
4 Source variable class Input Char(10)
5 Source variable precision Input Binary(4)
6 Edit mask Input Char(*)
7 Edit mask length Input Binary(4)
8 Zero balance fill character Input Char(1)
9 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: Yes

The Edit (QECEDT) API uses an edit mask to transform a numeric from its internal format to a character form suitable for displaying.


Authorities and Locks

None.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

Receives the edited output. The length of this area must be passed in the receiver variable length parameter.

Receiver variable length
INPUT; BINARY(4)

The length of the referenced area by the receiver variable parameter. This value must be greater than 0.

This value was returned in the receiver variable length parameter on the previous call to the Convert Edit Code (QECCVTEC) API or Convert Edit Word (QECCVTEW) API; otherwise, CPF27AF is returned.

Source variable
INPUT; *

The numeric value that is converted. The type is defined by the source variable class parameter and the length is specified in the source variable precision parameter.

Source variable class
INPUT; CHAR(10)

The type of numeric variable passed in the source variable parameter.

The types are:

*BINARY
*PACKED
*ZONED

Source variable precision
INPUT; BINARY(4)

The precision of the numeric variable specified in the source variable parameter.

The value passed must be from 1 through 31.

Variable
Class
Precision
Packed The precision for which the variable was declared. For example, PACKED(8,4) has precision 8.
Zoned The precision for which the variable was declared. For example, ZONED(8,4) has precision 8.
Binary(2) 5
Binary(4) 10

Note: Some high-level languages limit the maximum precision of packed and zoned numeric variables.

Edit mask
INPUT; CHAR(*)

The edit mask used for this edit operation. This is the value returned in the edit mask parameter on the call to the QECCVTEC API or QECCVTEW API.

Edit mask length
INPUT; BINARY(4)

The length of the edit mask. The value passed must be from 1 through 256. This is the value returned in the edit mask length parameter on the call to the QECCVTEC API or QECCVTEW API.

Zero balance fill character
INPUT; CHAR(1)

Indicates how to perform the edit operation so that zero balance suppression is done correctly for those edit codes that have zero balance suppression.

If the QECCVTEC API is used to create the edit mask, this should be the value returned in the zero balance fill character parameter; otherwise, unpredictable results may occur.

If the QECCVTEW API is used to create the edit mask, X'00' should be specified for this parameter; otherwise, unpredictable results may occur.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


Error Messages

Message ID Error Message Text
CPF27AB E Source variable class not valid.
CPF27AF E Edit mask not valid.
CPF27B4 E Source variable precision not valid.
CPF27B7 E Receiver variable length not valid.
CPF27B8 E Edit mask length not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.


API introduced: V2R2
Top | Edit Function APIs | APIs by category