Create Edit Description (CRTEDTD)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Create Edit Description (CRTEDTD) command defines an edit mask for the specified edit description and stores it in the QSYS library. As many as five edit descriptions can be defined by the user. A version of each of these edit descriptions is supplied in the QSYS library. More information about the IBM-supplied versions is in the Application Display Programming book, SC41-5715. To create a new version, the IBM-supplied version must first be deleted by the Delete Edit Description (DLTEDTD) command.

Edit descriptions can be used in data description specifications and high-level language programs to edit numeric fields.

Top

Parameters

Keyword Description Choices Notes
EDTD Edit description 5, 6, 7, 8, 9 Required, Positional 1
INTMASK Integer mask Character value, *NONE Optional
DECPNT Decimal point character Character value, '.', *NONE Optional
FRACMASK Fraction mask Character value, *NONE Optional
FILLCHAR Fill character Character value, *BLANK Optional
CURSYM Currency symbol Character value, *NONE Optional
ZEROBAL Edit zero values *YES, *NO Optional
NEGSTS Negative status characters Character value, *NONE Optional
POSSTS Positive status characters Character value, *NONE Optional
LFTCNS Left constant characters Character value, *NONE Optional
RGTCNS Right constant characters Character value, *NONE Optional
TEXT Text 'description' Character value, *BLANK Optional
AUT Authority Name, *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE Optional
Top

Edit description (EDTD)

Specifies a single-digit code (5, 6, 7, 8, or 9) that identifies the user-defined edit description being created. The actual name of the created object (which is stored in the QSYS library) is QEDITn, where n is the single-digit edit code specified in this parameter.

This is a required parameter.

Top

Integer mask (INTMASK)

Specifies a character string (mask) that describes the editing of the integer portion of a decimal field. Characters other than a blank, a zero, or an ampersand (&) are handled as constants in the editing process. Blank, zero, and ampersand have the following meanings:

Note: You cannot specify both INTMASK(*NONE) and FRACMASK(*NONE) on the CRTEDTD command. Instead, specify blanks for INTMASK and FRACMASK, and specify GENLVL(30) on the Create Printer File (CRTPRTF) or Create Display File (CRTDSPF) command, which allows the file to create, but ignores the edit code keyword.

The possible values are:

*NONE
No editing mask is used on the integer portion of decimal fields.
'integer-mask'
Specify the character string that is used as the editing mask for the integer portion of a decimal field. A maximum of 31 characters, enclosed in apostrophes, can be used in the integer mask.
Top

Decimal point character (DECPNT)

Specifies, for decimal fields, a single character used as a decimal point to separate the integer (INTMASK) and fraction (FRACMASK) portions of the edited result. If the field has no decimal places, this character is not used and is not considered in the width of the edited results.

Note: If the separator character specified for DECPNT is also used in the INTMASK parameter, it has no special meaning in the integer mask; it is handled only as a constant or as a digit replacement character in the integer mask.

The possible values are:

' . ' (period)
The period (or decimal point) is the separator character. It must be enclosed in apostrophes.
*NONE
No separator character is specified; a decimal point is not needed in the edited result.
'separator-character'
Specify the separator character, such as the comma (,), that is used as a decimal point. Any alphanumeric or special character can be used, but a special character must be enclosed in apostrophes.
Top

Fraction mask (FRACMASK)

Specifies a character string (mask) that describes the editing of the fraction portion of a decimal field (to the right of the decimal point). The characters have the same meaning as described for the Integer mask prompt (INTMASK parameter) except that all zeros are handled as constants and blanks are not replaced with a fill character.

The possible values are:

*NONE
No editing mask is used on the fraction portion of decimal fields.
'fraction-mask'
Specify the character string that is used as the editing mask for the fraction portion of a decimal field. A maximum of 31 characters, enclosed in apostrophes, can be used in the fraction mask.
Top

Fill character (FILLCHAR)

Specifies the character that is used in each position of a result that is zero suppressed. The specified character replaces all leading zeros that are to the left of the first significant digit in the integer mask (or a forced zero).

The possible values are:

*BLANK
The fill character is a blank.
'fill-character'
Specify the character that is used as the fill character. Any alphanumeric or special character can be used, but a special character must be enclosed in apostrophes.
Top

Currency symbol (CURSYM)

Specifies the character string that is used as the floating currency symbol. The character string specified appears immediately to the left of the first significant digit (or constant). If the first significant digit is a zero, occurring in the position that ended zero suppression, the character string ends in the position occupied by that zero.

The possible values are:

*NONE
No floating currency symbol is specified; none is needed in the edited result.
'floating-currency-symbol'
Specify the character string that is used as the floating currency symbol for monetary amount fields. A maximum of 15 alphanumeric and special characters, enclosed in apostrophes, can be specified.
Top

Edit zero values (ZEROBAL)

Specifies the editing action for zero values.

The possible values are:

*YES
The normal editing rules are followed. (For information on Editing rules, refer to the description of the Create Edit Description (CRTEDTD) command in the CL Reference manual.
*NO
If the field being edited has a value of zero, the entire field (integer, decimal point, or fraction) is replaced by the fill character, including constants in the edit mask.
Top

Negative status characters (NEGSTS)

Specifies the character string that immediately follows the body of the edited result if the field is negative. If the field is positive, blanks are substituted for the length of the string, unless a value is also specified for the Positive status characters prompt (POSSTS parameter).

The possible values are:

*NONE
No character string is specified; blanks are used to the right of the field in the edited result.
'negative-status-character-string'
Specify the character string that immediately follows the edited field when the field is negative in value. A maximum of 31 characters, enclosed in apostrophes, can be specified as the negative status character string.
Top

Positive status characters (POSSTS)

Specifies the character string that immediately follows the body of the edited result if the field is positive or zero. If the field is negative, blanks are substituted for the length of the string unless a value is also specified for the Negative status characters prompt (NEGSTS parameter).

The possible values are:

*NONE
No character string is specified; blanks are used to the right of the field in the edited result.
'positive-status-character-string'
Specify the character string that immediately follows the edited field when the field is positive in value. A maximum of 31 characters, enclosed in apostrophes, can be specified as the positive status character string.
Top

Left constant characters (LFTCNS)

Specifies the character string constant that always appears as the farthest left portion of the edited result.

The possible values are:

*NONE
No constant appears on the left side of edited fields.
'left-constant'
Specify the character string that always appears on the left side of an edited field. A maximum of 31 characters, enclosed in apostrophes, can be specified.
Top

Right constant characters (RGTCNS)

Specifies the character string constant that always appears as the farthest right portion of the edited result.

The possible values are:

*NONE
No constant appears on the right side of edited fields.
'right-constant'
Specify the character string that always appears on the right side of an edited field. A maximum of 31 characters, enclosed in apostrophes, can be specified.
Top

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

The possible values are:

*BLANK
No text is specified.
'description'
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Authority (AUT)

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

The possible values are:

*LIBCRTAUT
The authority for the object is the same as the create authority for QSYS. The create authority for QSYS can be displayed by using the Display Library Description (DSPLIBD) command. If the create authority is changed with the Change Library (CHGLIB) command, the new authority will not affect existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
authorization-list-name
Specify the name of an authorization list. Users included on the authorization list are granted authority to the object as specified by the list. The authorization list must exist when the object is created.
Top

Examples

The examples assume the following:

FIELDA
Six digits (four integer and two decimal positions) with a value of 001234
FIELDB
Same as FIELDA but with a negative value (-001234)
FIELDC
Same as FIELDA but with a zero value (000000)
DATE
Six digits (0 decimal positions) with a value of 091878

The character b is used to represent blank spaces.

Example 1: Create Edit Description 5

CRTEDTD   EDTD(5)  INTMASK('   ,   ,  0')  FRACMASK('    ')
          NEGSTS('DB    ')  POSSTS('CREDIT')
          LFTCNS('$')  RGTCNS(' **')

FIELDA
Logical mask is '$b,bb0.bbDBbbbb b**' for a negative value or '$b,bb0.bb CREDIT b**' for a positive value

Edited result is $bbb12.34CREDITb**

FIELDB
Same logical mask

Edited result is $bbb12.34DBbbbbb**

FIELDC
Same logical mask

Edited result is $bbbbb.00CREDITb** or, if ZEROBAL(*NO) had been specified, $bbbbbbbbCREDITb**

Example 2: Create Edit Description 6

CRTEDTD   EDTD(6)  INTMASK('   . 0 ')  DECPNT(',')
          FRACMASK('   ')  CURSYM('DM')  NEGSTS('- **')

FIELDA
Logical mask is 'bbb.b0b,bb-b**' with floating DM

Edited result is bbbDM12,34bbbb

FIELDB
Same logical mask

Edited result is bbbDM12,34-b**

FIELDC
Same logical mask

Edited result is bbbbDM0,00bbbb or, if ZEROBAL(*NO) had been specified, bbbbbbbbbbbbbb

Example 3: Create Edit Description 7

CRTEDTD   EDTD(7)  INTMASK('0 MONTH  DAY  YEAR')
          LFTCNS('DATE IS ')

DATE
Logical mask is equal to the INTMASK parameter value

Edited result is DATEbISbb9MONTH18DAYb78YEAR

Example 4: Create Edit Description 9

CRTEDTD   EDTD(9)  INTMASK('  ,  0')  DECPNT('.')
          FRACMASK('  ')  FILLCHAR('*')  NEGSTS(' ERROR **')

FIELDA
Logical mask is 'b,bb0.bbbbbbbbbbb' or 'b,bb0.bbbERRORb**' (Both use the * as the fill character)

Edited result is ***12.34bbbbbbbbb

FIELDB
Same logical mask

Edited result is ***12.34bERRORb**

FIELDC
Same logical mask

Edited result is *****.00bbbbbbbbb or, if ZEROBAL(*NO) had been specified, ********bbbbbbbbb

Top

Error messages

*ESCAPE Messages

CPF9805
Object &2 in library &3 destroyed.
Top