Convert Edit Word (QECCVTEW) API


  Required Parameter Group:

1 Edit mask Output Char(256)
2 Edit mask length Output Binary(4)
3 Receiver variable length Output Binary(4)
4 Edit word Input Char(*)
5 Edit word length Input Binary(4)
6 Error code I/O Char(*)

  Optional Parameter Group:

7 Source length Input Binary(4)
8 Currency symbol Input Char(1)

  Default Public Authority: *USE

  Threadsafe: Yes

The Convert Edit Word (QECCVTEW) API translates an edit word specification into an edit mask. This is useful when one of the standard or user-defined edit codes does not provide the editing required.

Authorities and Locks

None.


Required Parameter Group

Edit mask
OUTPUT; CHAR(256)

Returns the edit mask generated by this call. The actual length of the edit mask is returned in the edit mask length parameter. The area beyond the actual length of the edit mask is filled with hexadecimal zeros.

The value returned to this parameter should be passed to the Edit (QECEDT) API or the edit machine instruction.

Edit mask length
OUTPUT; BINARY(4)

Returns the actual length of the edit mask parameter.

The value returned in this parameter should be passed to the QECEDT API or used to substring the value returned in the edit mask in the edit machine instruction.

Receiver variable length
OUTPUT; BINARY(4)

The actual length of the output that is produced by the returned edit mask when it is used.

The value returned in this parameter should be passed to the QECEDT API or used to substring the value returned in the receiver variable in the edit machine instruction.

Edit word
INPUT; CHAR(*)

The edit word is translated into an edit mask. If the optional currency symbol parameter is not used, the character in the system value QCURSYM is treated as a currency symbol if it appears in the edit word.

Edit word length
INPUT; BINARY(4)

The actual length of the edit word. The value passed must be from 1 through 256.

Error code
I/O; CHAR(*)

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


Optional Parameter Group

Source length
INPUT; BINARY(4)

The length of the source data that is to be edited. The length used is the same as the value that would be used for the source variable precision parameter of the QECEDT API.

An edit word may begin with a zero suppression character. If it does, two different edit word combinations can be provided:

If the edit word provided is the second form, use this parameter. Otherwise, an incorrect edit mask is generated because QECCVTEW assumes the first form of editing is intended.

Currency symbol
INPUT; CHAR(1)

The currency symbol to be placed in the edited output. If this value appears in the edit word, it is used as the currency symbol.

If the value passed for currency symbol is X'00' (HEX zero), the API uses the system value QCURSYM as the currency symbol.


Error Messages

Message ID Error Message Text
CPF2620 E Field longer than integer or fraction mask.
CPF2639 E Edit mask too large.
CPF265E E Number of parameters specified not valid.
CPF27B6 E Edit word length not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.


API introduced: V2R2

[ Back to top | Edit Function APIs | APIs by category ]