The effects of an edit pattern include the following:
Some elements can be applied only to left entry or right entry fields. For example, characters in left entry fields only need to satisfy the requirements of their position in the field; characters in right entry fields must satisfy the requirements of the edit pattern for all positions to their right.
The following sections examine all of the elements used in edit patterns. Related elements have been grouped into sections as follows:
The following table lists the number element symbols and their meanings. Note that correct symbol case is important.
Table A1-1: Element Symbols Meanings
| Symbol | Meaning |
| * | Print a digit in this position. If it is an empty leading position, print "*" instead. If it is an empty trailing position after a decimal point, print "0". |
| 9 | Print a digit in this position. If it is an empty leading position, print "0" instead. If it is an empty trailing position after a decimal point, print "0". |
| Z | Print a digit in this position. If it is an empty leading position, print a space instead. If it is an empty trailing position after a decimal point, print "0". |
| F | Print a digit in this position. If it is an empty leading position, print nothing. If it is an empty trailing position after a decimal point, print "0". |
Notes:
Entry: 1234567 Left Entry Field Right Entry Field Pattern 1234567*** ***1234567 ********** 1234567000 0001234567 9999999999 1234567 1234567 ZZZZZZZZZZ 1234567 1234567 FFFFFFFFFF Entry: 0000000000 Left Entry Field Right Entry Field Pattern 0000000000 ********** ********** 0000000000 0000000000 9999999999 0000000000 ZZZZZZZZZZ 0000000000 FFFFFFFFFF
In the right entry fields, this entry is treated as having only empty leading positions.
In the left entry fields, this entry is treated as not having empty leading positions. Since there are no empty positions, the entry is displayed as entered in all of the left entry fields.
Entry: 001100 Left Entry Field Right Entry Field Pattern 001100**** ******1100 ********** 0011000000 0000001100 9999999999 0011000000 1100 ZZZZZZZZZZ 1234567 1100 FFFFFFFFFF
In the right entry fields, this entry is treated as having six empty leading positions: the four empty positions on the left side of the data, plus the two leading "0"s (zeros) in the entry. The edit pattern determines the characters that will be displayed in the empty leading positions.
In the left entry fields, this entry is treated as having four empty leading positions: the four positions on the right side of the data. The removal of the two leading "0"s in the entry would change its value; these positions are not considered empty leading positions and the "0"s are displayed as entered.
A.1.2 Sign Elements
Sign elements control the position, form, and display of plus and minus
signs in the field. Sign elements can be applied to right entry fields
only. Only one sign element may be used per field.
The following table lists the sign element symbols and their meanings. Note that correct symbol case is important.
Table A1-2: Element Symbols and Meanings
| Symbol | Meaning |
| S | If the value to be printed is negative, print "-" at this position; if it is positive, print "+". |
| - | If the value to be printed is negative, print "-" at this position; if it is positive, print a space. |
| N | If the value to be printed is negative, print "-" at this position; if it is positive, print nothing. |
| | | Distinguishes between positive and negative entries in an edit pattern.
When used with two different edit patterns, it formats a positive value
according to the first pattern; and negative value according to the second.
The edit patterns may include any of the elements described in this chapter.
There may be only one "|" per field. |
Notes:
The following tables show the effects of sign elements, in conjunction with number elements, on data display.
Entry: 123456789 Field Pattern +123456789 SZZZZZZZZZ 123456789 -ZZZZZZZZZ 123456789 NZZZZZZZZZ
Entry: -123456789 Field Pattern -123456789 SZZZZZZZZZ -123456789 -ZZZZZZZZZ -123456789 NZZZZZZZZZ
A.1.3 Decimal Point Elements
The decimal element controls the position of the decimal place in a field.
It does not display a decimal point character (.) in the position. The
decimal point element applies to right entry fields only. Only one decimal
element may be used per field.
The following table gives the decimal element symbol and its meaning. Note that correct symbol case is important.
Table A1-3: Decimal Element Symbols and Meanings
| Symbol | Meaning |
| V | Position of the value's decimal point. If "V" is not used, the decimal point is assumed to be at the extreme right of the field. |
Notes: This symbol does not produce any output; a decimal point character can be displayed in a field using a character element to print a period (.) in the appropriate position.
Examples
The following example illustrates the effects of decimal elements, in conjunction with numeric elements, on data display.
Entry: 1.1
Right Entry Field Pattern
1 ZZZZZZZZZZ
11 ZZZZZZZZVZ
110 ZZZZZZZVZZ
A.1.4 Character Elements
The character elements control the input or display of characters. In addition,
they can automatically display a specific character in a specified position
in the field. Character elements can only be applied to left entry fields.
The following table lists the character element symbols and their meanings. Note that correct symbol case is important.
Table A1-4: Character Elements
Symbols and Meanings
| Symbol | Meaning |
| A | Print a letter in this field position. If there is no data in this field position, print a space. |
| X | Print an alphanumeric character in this field position. If there is no data in this field position, print a space. |
| C | Print any printable character in this field position. If there is no data in this field position, print a space. |
| character | Print the specified character in this field position. |
| \character | Print the character following the "\" in this field position. If the character would normally be a special character, its special meaning is lost. |
| @character | Print the character following the "@" sign but do not print it if it would occur in an otherwise empty position, i.e., in a leading position. If the character would normally be a special character, its special meaning is lost. |
Notes: The character elements which force the display of a specific character in a specified field must be used in conjunction with elements that format data supplied for the field. It is not possible to specify an edit pattern composed solely of forced-display character elements.
Examples
The following examples illustrate the effects of character elements on data display.
Entry: asdfasdfas Field Pattern asdfasdfas CCCCCCCCCC asdfasdfas XXXXXXXXXX asdfasdfas AAAAAAAAAA
Entry: asdfasdfas
Field Pattern
1234567890 CCCCCCCCCC
1234567890 XXXXXXXXXX
AAAAAAAAAA
This value does not satisfy the requirements of the third edit pattern, which restricts characters to letters. Attempts to display it in the associated field produce an error message. The value satisfies the requirements of the remaining edit patterns, and is displayed as entered.
Entry: !@#$%^&*()
Field Pattern
!@#$%^&*() CCCCCCCCCC
XXXXXXXXXX
AAAAAAAAAA
This value does not satisfy the requirements of the third edit pattern, which restricts valid characters to letters, and of the second edit pattern, which restricts valid characters to letters and numbers. Attempts to display the value in the associated fields are met with an error message. The value does satisfy the requirements of the first edit pattern and is displayed as entered.
Entry: asdf Field Pattern asdf CCCC@!CCCC@! asdf! ! CCCC!CCCC!
The entry in this example consists of four characters. The value satisfies the requirements of both edit patterns and is displayed with the specified forced characters in the specified locations. Note that no character is forced in the first field because it would appear in an otherwise empty leading position, which is prohibited by the edit pattern.
A.1.5 Date Elements
Date elements control the input or display of dates in a field. Date elements
can only be applied to left entry fields.
The following table lists the date element symbols and their meanings. Note that correct symbol case is important.
Table A1-5: Date Elements Symbols and Meanings
| Symbol | Meaning |
| MM | Print the month in this position. |
| DD | Print the day in this position. |
| YY | Print the year in this position. |
Notes:
The following examples illustrate the effects of date elements, in conjunction with forced character elements, on data display. In all examples, the entry field is of data type CHAR.
Entry: 31/1/92 Field Pattern 31/01/92 DD/MM/YY 31/01/1992 DD/MM/YYYY 1992 yyyy
Entry: 19920131 Char Field Pattern 31/01/92 DD/MM/YY 31/01/1992 DD/MM/YYYY 1992 yyyy
Entry: 31/1/92
Date Field Pattern
DD/MM/YY
DD/MM/YYYY
yyyy
The expression failed - invalid argument or operand.
Entry: 31/1/92 Field Pattern 3_/__/__ DD/MM/YY 3_/__/____ DD/MM/YYYY 1___ yyyy
This screen shows the effects of entering the first numeric character of the appropriate date value. Fields are fully defined on the screen when the first character is entered. Slashes are displayed in the field in accordance with the associated edit pattern. Attempts to enter a non-numeric character are rejected and signalled with a beep.
No interpretation of data values is performed on entry. If data checking is required, it must be performed in the exit script of each field.