COBOL description of a generated Screen
The COBOL code is generated from the information that is indicated in the design editor of the instance and from the possible insertions of specific code. To help you understand the generated COBOL code and decide where to insert your specific code, this page explains the variables that are present in the COBOL code and describes the generated functions.
A generation is possible from a Screen whose type is standard, Client, or Client Monitor.
The generated COBOL code is adapted to the hardware, operating system, and TP monitor that are indicated in the Definition of the Dialog or Screen.
The WORKING-STORAGE SECTION and the PROCEDURE DIVISION are described in detail in this page.
WORKING-STORAGE SECTION
The WORKING-STORAGE SECTION contains the constants and variables that are used by the Screen.
Code | Meaning |
---|---|
CURPOS | Cursor position in Screen. CPOSL represents the line number and CPOSC represents the column number. |
CPOSN | Absolute cursor position in Screen. The origin is CPOSL=1 and CPOSC=1. |
INA | Number of Data Elements in the Screen-top category. |
INR | INA + number of Data Elements in the repetitive category. |
INZ | INA + number of Data Elements in the Screen-bottom category. |
IRR | Number of repetitions in the repetitive category. |
INT | Number of input fields in the Screen. |
IER | Number of error messages on the Screen. |
PRDOC | External name of the help program. |
DATOR | Field that stores the date of processing as YEAR-MONTH-DAY. |
DATSEP | Separator for dates (default value: /). |
DATSET | Separator for dates (default value:-). |
DAT6, DAT7, and DAT8 | Fields for date formatting as DDMMYY or YYMMDD and output format (DD/MM/YY for example). They are generated if a variable Data Element has a date format. |
DATCTY | Field for loading the century. |
DAT6C and DAT7C | Non-formatted date with century. |
DAT8C | Non-formatted date with century (MM/DD/CCYY). |
DAT8G | Gregorian-formatted date with century (CCYY/MM/DD). |
TIMCO | Field for loading the time. |
TIMDAY | Field for loading the formatted time (HH:MM:SS). |
5-xxnn-PROGE | Field that contains the name of the program to branch to. |
Code | Meaning |
---|---|
ICF | Input configuration variable:
|
OCF | Output configuration variable:
|
OPER | Operation code:
|
OPERD | Operation code for deferred branching: O: Deferred call to another Screen Initialized in F0520 and moved into OPER in F40 |
CATX | Code of the category under processing:
|
CATM | Transaction code:
|
ICATR | Indicator for the category under processing (repetitive category only) |
FT | Indicator for the end of the repetitive category:
|
ddss-CF | Indicator for the configuration of Segment ddss:
|
IK | Indicator for error on file access:
|
Code | Meaning |
---|---|
SCR-ER | Indicator of Screen error:
|
CAT-ER | Indicator of category error:
|
ER-scrn-delco | Indicator of Data Element (delco)
error:
|
PROCEDURE DIVISION
Function code | Function goal |
---|---|
F0110 | Initializations. This function is always generated. It initializes the work areas. It sets the processing to be run if an error occurs. It branches to the physical display function after the consultation of the help documentation (if a documentation help character is entered on the Screen definition line). It sets the cursor position for the first display. |
F05 | Reception and control of the operation code
(ICF=1). This function contains the conditions for all the processing of the reception part of the COBOL, from F05 to END-OF-RECEPTION (F45-FN). The automatic functions in this part of the COBOL are generated if at least variable Data Element is declared as variable. |
F0510 | Reception of the input message. |
F0512 | Processing of documentation call if a help documentation call is specified in the Screen Definition. It initializes the fields that are required for the branching to the help documentation Screen. |
F0520 | Setting of the operation code. This subfunction is generated if a variable Data Element or a special function key Data Element is defined as an operation code in the Screen -CE Lines. The OPER internal operation code is set according to the value of the Data Element that is declared as the operation code. If an error is detected on the operation code value, the processing that comes next in reception is not run. |
F1010 | Setting of the category to be processed. This
function sets the category to be processed in reception by using the CATX indicator.
This indicator can take the following values:
The processing is then generated according to the categories that are defined for the Screen. If no category is defined, the Screen is considered to be a Screen-top category. This function includes
the following processing for the repetitive category:
If an error is detected (CAT-ER=E) when the processing of a category is complete (F15 to F3999-ITER-FI), SCR-ER is set and the validation processing on the subsequent categories is not run. |
F15 | Setting of the transaction code. This function is generated if at least one Data Element is defined as a transaction code in a category of the Screen. The internal transaction code
(CATM) is set according to the value of the Data
Element that is defined as a transaction code for the category. This
definition can be indicated at 2 levels:
The following subfunctions are generated according to
the categories that contain a transaction code:
If the transaction code is wrong, the subsequent reception processing is not run. |
F20 | Data Element validation. This function is generated when a variable Data Element is specified on the Screen. The
following subfunctions are generated according to the categories that
contain a Data Element to validate:
The processing of each category contains a subfunction per Data Element to be validated. The following validations
are run:
The conditions of each subfunction are generated according to the Data Element processing option. The validation result
for each Data Element is stored in a field that is named ER-scrn-delco (with scrn:
last 4 characters of the Screen name and delco: Data
Element name). This field can take the following values:
CAT-ER is set when an error on a Data Element or a user error is detected. Subfunctions are numbered according to the number of Data Elements, their position on the Screen, and other parameters. As a result, direct references must not be made to a label that is generated in specific processing. You must use a relative positioning insertion. |
F25 | Segments to be accessed in reception. This function is generated when a Segment is accessed in reception. The
following subfunctions are generated according to the categories that
contain a Segment to be accessed in reception:
The processing of each category includes a subfunction
for each access to a Segment. The following processing is run:
Subfunction F2599 is generated if at least one Segment to be read can be updated. It contains the PERFORM of the F80-ddss-UN functions, according to the Segments in use. It also sets the cursor on the first variable Data Element in the category, if there is an error on a Segment. Subfunctions are numbered according to the number of Data Elements, their position on the Screen, and other parameters. As a result, direct references must not be made to a label that is generated in specific processing. You must use a relative positioning insertion. |
F30 | Transfer of Data Elements. This function transfers the Data Elements of the Screen to the corresponding Data Elements of the Segments. The following subfunctions are generated according
to the categories that contain a Data Element transfer in reception:
|
F35 | Segment updates. This function updates the Segments. If an error is detected by the error checks (CAT-ER), this function is not run. The following subfunctions are generated
according to the categories that contain a Segment to be updated:
This function is accessed by running a PERFORM of the appropriate subfunction in F80. The processing of each category contains one subfunction per Segment to be updated, possibly including several types of access. For a Segment that
does not follow an access to another Segment (no previous Segment),
the access is conditioned by the value of the internal transaction
code (CATM) for the category. The following values
are possible:
For a Segment that follows an access to another Segment,
the access is conditioned by the Segment configuration:
The 'transaction code' Data Element of the category or the repetitive category line is reset to blank after the update. Subfunctions are numbered according to the number of Data Elements, their position on the Screen, and other parameters. As a result, direct references must not be made to a label that is generated in specific processing. You must use a relative positioning insertion. |
F3999-ITER-FN | GO TO F10 |
F3999-ITER-FT | EXIT |
F40 | This function contains the end-of-reception processing. It is run if no error is found. |
F4010 | Loading the keys for a new display. This subfunction is run for a display or an update operation. It assigns values to the keys of the Segments that have no previous Segment and that are used in display. Depending on the categories, the access key
for the Segments in display is stored in the following subfunctions:
|
F4020 | Loading the keys for Screen paging. This subfunction is run for a Screen continuation operation. It stores the first key for the display of the Screen continuation, if the Segment is used in the repetitive category. |
F4030 | End of transaction. |
F4040 | Transfer to another Screen. |
F45-FN | END-OF-RECEPTION |
F50 | This function contains the conditions for the
processing of the display part of the COBOL, from F50 to END-OF-DISPLAY
(F78-FN). If an error is detected, a branching to the error processing function is run. The fields of valid Data Elements remain unchanged and are not transferred to the lines. |
F5010 | This subfunction is always generated. It initializes the work areas and the description of the display Screen. |
F55 | Management of the category. This function
sets the category to be processed in display according to the value
of the CATX indicator, which can be as follows:
The processing is then generated according to the categories that are defined for the Screen. If no category is defined, the Screen is considered to be a Screen-top category. This function includes
the following processing for the repetitive category:
|
F60 | Accessing the Segments in display. This function
is generated when a Segment is to be accessed for display. The following
subfunctions are generated according to the categories that contain
a Segment to be accessed for display:
The processing of each category includes a subfunction
for each access to a Segment. The following processing is run:
If a Segment has a previous Segment, its read is always a direct read, even in the repetitive category. Subfunctions are numbered according to the number of Data Elements, their position on the Screen, and other parameters. As a result, direct references must not be made to a label that is generated in specific processing. You must use a relative positioning insertion. |
F65 | Data Elements transfer. This function transfers
the Segment Data Elements to the corresponding Data Elements on the
Screen. The following subfunctions are generated according to the
categories that contain the transfer of a Data Element for display:
|
F6999-ITER-FN. | GO TO F55 |
F6999-ITER-FT. | EXIT |
F70 | Error processing. This function is always
generated. It contains the following processing:
|
F7020 | Setting of the attributes. This subfunction is generated if the Screen contains at least a variable field. |
F78-FN | END-OF-DISPLAY |
F8Z | This function is always generated. |
F8Z05 | Help subfunction This subfunction is generated if a documentation help request is entered on the Screen Definition. |
F8Z10 | Screen display. This subfunction contains the display of the Screen according to the type of COBOL code. |
F8Z20 | End of program. |
F80 F8095 F8098 |
Physical accesses. Screen backup (call of documentation) Access to the error message file |
F81 F81ER F81UT F8110 F8115 F8120 F8125 F8130 F8135 F8140 |
Functions called by PERFORM. Abnormal end processing Memorization of user errors Presence of numeric fields Initialization of variable fields Validation and formatting of a date Transfer of variable fields Help function processing Transfer in reception Cursor position calculation |