+-------------------------------IBM Extension--------------------------------+
An ACCEPT statement is considered an extended ACCEPT statement if it:
An ACCEPT statement is considered a standard ACCEPT statement if it:
ACCEPT Statement - Format 7 - Workstation I/O
.----------------------------.
V |
>>-ACCEPT--identifier-1----+------------------------+-+--------->
+-| line-column-phrase |-+
+-FROM CRT---------------+
+-MODE-+----+-BLOCK------+
| '-IS-' |
'-| with-phrase |--------'
>--+-------------------------------------------+---------------->
'-+----+--EXCEPTION--imperative-statement-1-'
'-ON-'
>--+------------------------------------------------+----------->
'-NOT--+----+--EXCEPTION--imperative-statement-2-'
'-ON-'
>--+------------+----------------------------------------------><
'-END-ACCEPT-'
line-column-phrase:
.----------------------------------------.
V |
|--+-+----+---+-LINE---+-+--------+-+-identifier-2-+-+-+--------|
| '-AT-' +-COLUMN-+ '-NUMBER-' '-integer-1----' |
| '-COL----' |
'-AT-+-identifier-3-+-------------------------------'
'-integer-2----'
with-phrase:
|--WITH--------------------------------------------------------->
.---------------------------------------------------.
V |
>----+-+-AUTO------+---------------------------------+-+--------|
| '-AUTO-SKIP-' |
+-+-BELL-+--------------------------------------+
| '-BEEP-' |
+-BLINK-----------------------------------------+
+-+-FULL---------+------------------------------+
| '-LENGTH-CHECK-' |
+-HIGHLIGHT-------------------------------------+
+-+-REQUIRED----+-------------------------------+
| '-EMPTY-CHECK-' |
+-REVERSE-VIDEO---------------------------------+
+-+-SECURE--+-----------------------------------+
| '-NO-ECHO-' |
+-UNDERLINE-------------------------------------+
+-RIGHT-JUSTIFY---------------------------------+
+-SPACE-FILL------------------------------------+
+-TRAILING-SIGN---------------------------------+
+-UPDATE----------------------------------------+
+-ZERO-FILL-------------------------------------+
+-SIZE-+----+-+-identifier-4-+------------------+
| '-IS-' '-integer-3----' |
| (1) |
+-PROMPT------+--------------+-+-identifier-5-+-+
| '-CHARACTER IS-' '-literal-1----' |
| (1) |
+-+-FOREGROUND-COLOR------+-+----+-integer-4----+
| '-FOREGROUND-COLOUR-----' '-IS-' |
| (1) |
+-+-BACKGROUND-COLOR------+-+----+-integer-5----+
| '-BACKGROUND-COLOUR-----' '-IS-' |
| (1) |
'-LEFT-JUSTIFY----------------------------------'
Notes:
Identifier-1 can be an internal or external floating-point data item.
Fields accepted or displayed require an attribute byte before and after the field. To accomplish this, space must be available on the screen for, at a minimum, the initial display attribute. For this reason, line 1 and column 1 cannot be used for data because that position is required for the first display attribute. The lowest position that can be used on the screen for data is line 1, column 2.
For example:

The AT phrase sets the starting line and column for the fields that will be accepted or displayed. It does not indicate the position of the initial display attribute.
It is your responsibility to ensure that each field is positioned on the screen to prevent attribute bytes from overlaying data bytes, and to prevent data bytes from overlaying attribute bytes. You should also be aware that the ending attribute byte will be the normal attribute defined for the specific workstation. Therefore, you should ensure that the attributes are specified in the correct order to obtain the expected results.
You should initially clear the screen by using a DISPLAY statement that contains the WITH BLANK SCREEN phrase.
When identifier-1 does not fit within the screen, then alphanumeric data is truncated and numeric data is not put on the screen.
If identifier-1 is a group item and there is no MODE IS BLOCK phrase, those elementary subordinate items that have names other than FILLER are displayed. They are displayed simultaneously and positioned on the screen in the order that their descriptions appear in the DATA DIVISION, separated by the lengths of the FILLER items in the group. For this purpose, the first position on a line is regarded as immediately following the last position on the previous line.
When items are separated by FILLERs, the attribute bytes are included in the FILLER length, so a FILLER of one or two bytes would contain both the trailing and leading attributes of separate items. In the case of a one-byte FILLER, the trailing and leading attributes would occupy the same byte. Since data items are normally separated by one attribute byte, one-byte FILLER items are not necessary.
REDEFINES, POINTER, PROCEDURE-POINTER, and INDEX-NAME data are ignored when found in the group item without the MODE IS BLOCK phrase.
The extended ACCEPT statement predisplays the value of identifier-1, accepting only the changed value from the workstation after the ENTER key is pressed. Simply pressing the ENTER key does not cause an update of the predisplayed data item.
The accepted value is the image of the characters taken from the screen positions designated to the data item, and delimited by the cursor position at the time the FIELD EXIT key is pressed.
The FIELD EXIT key will convert all trailing spaces in the alphabetic and alphanumeric fields to hexadecimal zeroes when the default compiler option *UNDSPCHR is in effect. For example:
DATA DIVISION.
01 STRUC1.
03 F11 PIC AA VALUE 'A'.
03 F12 PIC 9(4) VALUE 123.
03 F13 PIC XXX VALUE 'B'.
PROCEDURE DIVISION.
ACCEPT STRUC1 AT 2102.
The ACCEPT statement in the example predisplays three fields:
Here is the visual result at line 21:

Note that numeric field F12 is right-justified, and its first position consists of a space.
When you place the cursor at the end of field F13 and press the FIELD EXIT key in response to the values of the three fields, the values of the fields remain unchanged. Trailing spaces (X'40') in F11 and F13 do, however, become hexadecimal zeroes, so the test IF F13='B ' will fail after the ACCEPT operation.
To avoid trailing hexadecimal zeroes, use the SPACE-FILL phrase. If existing programs already include extended ACCEPT statements without this phrase, and program changes are costly or not the desired solution, you can consider using the *NOUNDSPCHR compiler option. Use this option exclusively for programs in which the extended ACCEPT and extended DISPLAY statements handle displayable characters only.
The displayable-only characters will be handled if:
For example:
01 STRUC2.
03 F21 PIC 99.
03 F22 PIC 9(10) USAGE COMP-3 VALUE 1111123.
03 F23 PIC X(5).
ACCEPT STRUC2 MODE IS BLOCK AT 0102 will contain nondisplayable characters because it will be handled as one alphanumeric field 13 bytes long.
When the program runs on a workstation with a remote controller and with 5250 emulation, the ILE COBOL run time changes compiler option *UNDSPCHR, if it is in effect, to *NOUNDSDPCHR and sends an informational message to the user. When your system configuration encompasses a variety of workstation controllers, use of the *NOUNSDPCHR option is recommended to achieve consistency of results. To enforce this option effectively, specify NOUNDSPCHR on the PROCESS statement in the COBOL source program.
You should consider the following when using floating-point data items with the ACCEPT statement.
It is possible that when an external floating-point literal is ACCEPTed, slight inaccuracies can result. This is especially true if the floating-point data item is moved after it is ACCEPTed. The floating-point data type is an approximation, and when an external floating-point literal is moved, it is first converted to a true floating-point value (IEEE), which can also affect its accuracy.
For example, consider the following ACCEPT:
77 external-float-1 PIC +9(3).9(13)E+9(3).
ACCEPT external-float-1 FROM CRT.
DISPLAY "EXTERNAL-FLOAT-1=" external-float-1.
The displayed result after +123455779012.3453E+297 is ACCEPTed is:
EXTERNAL-FLOAT-1=+123.4557790123452E+306
The following table shows the data categories handled by the extended ACCEPT statement. These data categories are also supported by the extended DISPLAY statement. (The extended ACCEPT and DISPLAY statements do not support data items with scaling positions in the PICTURE clause.)
Table 29. Data Categories Handled by Extended ACCEPT
| Category | Initial Display | Entering Data | Data Item Updated |
|---|---|---|---|
| Alphabetic | A, B, C | D | B, C |
| Numeric (internal, binary, decimal or packed decimal) | B, C, E, F, F1, F2 | D, G, H | O |
| Numeric (zoned decimal) | B, C, F, F1, F2 | D, G, H | O |
| Numeric-edited | A, I | J, H | K, O |
| Alphanumeric | A, B, C | D | B, C |
| Alphanumeric-edited | A, I | J | L |
| Boolean | A, B, C | D, M, N | B, C |
| DBCS | A, B, C | D | B, C |
| DBCS-edited | A, B, C | D | B, C, L |
| Internal floating-point | A, I, I1, P | Q | O |
| External floating-point | A, I, I1 | Q | O |
If only SPACE-FILL is specified, trailing hexadecimal zeros are converted to spaces.
If only ZERO-FILL (or SPACE-FILL) is specified, the workstation does not make any conversions.
The sign must be entered in the leading or trailing position. The decimal point must be entered before the fractional digits. Digits are not justified. A comma separates each group of three integer digits.
The decimal digits may be divided into two parts: an integer part and a fractional part. Digits to the left of the decimal point are interpreted as integer values. Digits to the right are interpreted as fractional values. If no decimal point symbol is included, the value is interpreted as an integer value. If the decimal point symbol precedes the leftmost decimal digit, the digit value is interpreted as a fractional value, and the leftmost decimal digit must be adjacent to the decimal point symbol. If the decimal point follows the rightmost decimal digit, the digit value is interpreted as an integer value, and the rightmost decimal digit must be adjacent to the decimal point.
Decimal digits in the integer portion may optionally have comma symbols separating groups of three digits. The leftmost group may contain one, two, or three decimal digits, and each succeeding group must be preceded by the comma symbol and contain three digits. The comma symbol must be adjacent to a decimal digit on either side.
Decimal digits in the fractional portion may not be separated by commas and must be adjacent to one another.
The phrases following identifier-1 can be in any order. All phrases specified apply to the previous identifier.
The AT phrase indicates the absolute address on the screen at which the ACCEPT operation is to start. If the AT phrase is not specified, the ACCEPT operation starts at line 1, column 2. It does not indicate the starting position of the leading attribute.
The LINE phrase specifies the line at which the screen item starts on the screen.
The COLUMN phrase specifies the column at which the screen item starts on the screen.
COL is an abbreviation for COLUMN.
The LINE and COLUMN phrases can appear in any order.
Identifier-2 cannot be an internal or external floating-point data item.
Certain combinations of line and column numbers have special meaning:
Integer-2 must be a 4- or 6-byte numeric field.
If identifier-3 or integer-2 is 4 digits long, the first 2 digits specify the line, and the second 2 digits specify the column. If identifier-3 or integer-2 is 6 digits long, the first 3 digits specify the line, the second 3 digits specify the column.
Indicates that the ACCEPT statement is extended.
The identifier is to be treated as an elementary item; thus, even if it is a group item it is accepted as one item.
If ON EXCEPTION is specified, imperative-statement-1 is executed if the ACCEPT operation finishes with anything other than a normal completion. That is, if the CRT Status Key 1 is other than 0.
The use of the ON EXCEPTION phrase does not prevent the generation of a run-time message for such conditions as workstation boundaries or out-of-screen ranges.
If NOT ON EXCEPTION is specified, imperative-statement-2 is executed if the ACCEPT operation finishes with a normal completion.
END-ACCEPT is optional. It is required if ACCEPT statements are nested.
The WITH phrase allows the user to specify certain options for the ACCEPT operation. These options are described in the following phrases.
When a field has been filled by operator input, the cursor automatically steps to the next input field, rather than waiting for a terminating character to be entered. If the field is the last in a group, AUTO-SKIP acts as if the ENTER key had been pressed.
AUTO and AUTO-SKIP may be used interchangeably.
An audible alarm sounds each time the item containing this phrase is accepted.
BELL and BEEP may be used interchangeably.
The screen item blinks when it appears on the screen.
The operator must either leave the screen item completely empty or fill it entirely with data. The FIELD-EXIT, FIELD+, FIELD- keys are not allowed. Any attempt to use the delete key on the data within the input field, followed by the enter key, is also not allowed. The FULL phrase can be satisfied by data that is initially displayed.
If this phrase is specified at a group level, it applies to all suitable subordinate elementary items.
The FULL phrase is effective during the execution of any ACCEPT statement.
FULL and LENGTH-CHECK may be used interchangeably.
The screen item is in high-intensity mode when it appears on the screen.
The REQUIRED phrase is used to ensure that a field does not remain empty.
For alphanumeric items, this means that the field must contain at least one character other than a space or a hexadecimal zero. For numeric items, the field must contain a value of other than zero.
If a field remains empty when this phrase is specified, a run-time message will be issued which requires the user to press the reset key and then to re-enter the data.
REQUIRED and EMPTY-CHECK may be used interchangeably.
The screen item is displayed in reverse image.
Operator-keyed data is prevented from appearing on the screen. This phrase may be specified on a group screen item, in which case it applies to all suitable elementary items which are subordinate to that item. When the SECURE phrase is specified, only spaces and cursor appear in the screen item.
SECURE and NO-ECHO may be used interchangeably.
The screen item is underlined when it appears on the screen.
Operator-keyed characters are moved on the screen to the rightmost character positions of the field. Trailing spaces and trailing hexadecimal zeros are removed.
This option affects only non-edited data items. This takes effect upon display of the initial data in the data item and also upon termination of the ACCEPT operation. This is the only way in which numeric data are handled.
If the data item is defined with the JUSTIFIED RIGHT clause in the DATA DIVISION, then the data item is treated as if the RIGHT-JUSTIFY phrase had been specified.
Specifies the size of the data item on the screen. You can use this phrase with elementary data items only.
The SIZE phrase has no effect if the size you specify is zero. In this case, the length of the field is used to display the data item.
If you specify a size that is less than the size implied by the associated PICTURE clause, only the leftmost portion of the data item appears on the workstation display.
When the size specified for a numeric or numeric-edited data item is less than that implied by the PICTURE clause, truncation of the rightmost positions occurs when the value is displayed, or predisplayed in the ACCEPT operation. The data item is then updated following the rules for the MOVE operation.
If you specify a SIZE literal whose value causes the field length to exceed the screen size, alphanumeric data will be truncated and numeric data will be ignored and not displayed.
For justified items, only the rightmost portion appears when you specify a size that is smaller than the length of the item.
If the size you specify is greater than the size implied by the PICTURE clause, the displayed version of the item is padded with spaces. The padding occurs on the right.
For non-edited data items, trailing hexadecimal zeros are converted to spaces, and the items appear on the screen with zero-suppression in all character positions. This takes effect when initial data in the data item is displayed and again when the ACCEPT operation into the data item is terminated. This option has no effect on edited fields.
The operational sign appears in the rightmost character position of the field. This takes effect upon display of initial data in the data item and also upon termination of the ACCEPT operation. This option affects only signed, non-edited numeric data items. When this option is not specified, the sign precedes the number.
The current contents of the data item are displayed before the operator is prompted to key in any new data; the initial data is then treated as though it were operator-keyed.
In the absence of the UPDATE phrase, you can control the predisplaying of some data. To predisplay only numeric-edited data, specify the *ACCUPDNE option of the EXTDSPOPT parameter. To predisplay all data, use the default option, *ACCUPDALL.
Non-edited data items appear on the screen with no zero-suppression. For left-justified data, trailing spaces and trailing hexadecimal zeros are converted to zeros. For right-justified data, leading spaces are converted to zeros.
This takes effect when initial data in the data item is displayed and again when the ACCEPT operation into the data item is terminated. It has no effect on edited fields.
The following phrases are syntax checked
Syntax checked and then treated as documentation by the compiler.
If identifier-1 is a group item and there is no MODE IS BLOCK phrase, those elementary subordinate items that have names other than FILLER are accepted. They are positioned on the screen in the order that their descriptions appear in the DATA DIVISION, and are separated by the lengths of the FILLER items in the group.
For this purpose, the first position on a line is regarded as immediately following the last position on the previous line. The items are accepted in the same order.
Unless otherwise specified in the CURSOR clause, the cursor initially points at the start of the first item. As the ACCEPT operation into each item terminates, the cursor moves to the start of the next item.
The CURSOR clause has no effect on the position of the fields; it can only change the cursor position for the ACCEPT statement according to stated rules.
Numeric items with PICTURE clauses containing the symbol P are not supported by the extended ACCEPT statement.
Unless you specify MODE IS BLOCK, data items must not contain fixed-length tables. Data items must not contain variable-length tables whether or not you specify MODE IS BLOCK.
The following considerations are common to both the extended ACCEPT and the extended DISPLAY statements.
Extended ACCEPT and DISPLAY operations support a 24-line by 80-column screen format.
When extended ACCEPT or DISPLAY operations are processed, no other display file should be open by the program. If TRANSACTION files are coded in a program that contains extended ACCEPT or DISPLAY statements, it is the user's responsibility to ensure that TRANSACTION I/O does not interfere with extended ACCEPT or DISPLAY statements. Conversely, the user should ensure that extended ACCEPT or DISPLAY statements do not interfere with TRANSACTION I/O operations.
Subscripted items, and reference modified items are both supported.
Unless you specify the EXTDSPOPT(*NODFRWRT) parameter (no deferred writing) in the CRTCBLMOD or CRTBNDCBL command, the ILE COBOL compiler buffers all extended DISPLAY statements until the next ACCEPT statement is encountered. While the *NODFRWRT option allows you to associate data errors with the statements that cause them by performing DISPLAY statements as they are encountered, the deferred writing (*DFRWRT) option improves performance by buffering data streams generated by consecutive DISPLAY statements.
DBCS programs can run on a DBCS system only if they have been compiled on a DBCS system:
When one ACCEPT or DISPLAY statement contains the UNDERLINE, HIGHLIGHT and REVERSE-VIDEO phrases in one WITH phrase, the HIGHLIGHT phrase is ignored. A warning message (LNC0265) is generated at compilation time if this combination is coded. In an extended DISPLAY statement, the UPON CRT-UNDER phrase is equivalent to the UNDERLINE phrase. To protect a field from being displayed on the screen, use the SECURE option.
Using extended ACCEPT/DISPLAY statements and TRANSACTION files in the same program is not recommended. If extended ACCEPT/DISPLAY statements are used in the same program as TRANSACTION files, then the TRANSACTION file should be closed when the extended ACCEPT/DISPLAY statements are performed. Unpredictable results will occur if an extended ACCEPT/DISPLAY statement is performed when a TRANSACTION file is open. A severe error may be generated or data on the workstation may be overlapped or intermixed.
Extended ACCEPT and extended DISPLAY statements do not run on remote workstations attached to 5251 Model 12 controllers.
The EXTDSPOPT(*NOUNDSPCHR) parameter in the CRTCBLMOD or CRTBNDCBL command allows you to use extended ACCEPT and extended DISPLAY statements at remote workstations attached to 3174 and 3274 controllers, provided that your data does not contain undisplayable characters. The CLEAR and HELP keys cannot be used to accept data when using remote controllers.
The ILE COBOL extended ACCEPT and DISPLAY statements are similar to the ACCEPT and DISPLAY statements (Format 2). The exceptions are discussed in Appendix I, ACCEPT/DISPLAY and COBOL/2 Considerations.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.