COBOL description of a generated Server
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 Server whose type is Business Component, Server Monitor, Communication Monitor, or Error Message Server.
The generated COBOL code is adapted to the hardware, operating system, and TP monitor that are indicated in the Definition of the Server Dialog or Server.
The WORKING-STORAGE SECTION and the PROCEDURE DIVISION are described in detail in this page.
WORKING-STORAGE SECTION
The WORKING-STORAGE SECTION contains the variables that are used by the Server. They are generated according to the characteristics and calls of the various elements in the Server.
Code | Meaning |
---|---|
IK | Return code upon a Segment access or a Business
Component call:
|
CATM | Transaction code:
|
A-CATM | Description buffer. This buffer contains the action codes that are related to the Logical View data. |
A-CATM-CA | Action code that applies to non-repeated data. It is always generated. |
A-CATM-CR OCCURS N | Action code that applies to repeated data. N is the maximum number of repetitions for all the Logical Views in this Server. It is generated if a Logical View of the Business Component contains repeated data. |
ICATR | Indicator for the category under processing (repetitive data of the Logical View) |
ICATRC | Number of requested repetitions upon a Business Component call |
IRR | Number of repetitions that are requested by the Client |
OPERB | Indicates whether the requested selection is a list |
OPERS | Operation code |
OPERT | Management of check, update, and selection services |
OPERV | Logical View processing indicator:
|
OPER2 | Operation code for the call of a second-level Business Component |
CH-view | view is the Logical View. This
field contains a table for the Logical View checks. It is generated
if the CHECKSER=YES option is indicated in
the Complement tab of the Server Dialog or
Server. This table contains one item for each Data Element that is
called in the Logical View. The possible values (to be specified
in the Client) are the following values:
This field is also used to indicate whether the value of a field in the Logical View is null or not (according to the SQL terminology), so if it is present. For example, the Client can set null values for an update service and the Business Component can return null values for the selection if the corresponding fields in the table are null. |
L-CURS-EXTNAM | The closing of the cursor is conditioned at the end of a selection service if an extraction method is used. |
Code | Meaning |
---|---|
02 view-C | Data that is transferred from the Client to the Server and in both directions. view is the Logical View. |
02 view-S | Data that is transferred from the Server to the Client. When the Logical View contains repeated data, a level 01 is also generated. |
01 RE-view-delco | Repeated data (delco is the group Data Element for the repeated data) |
10 1-view-delco | Identifier of the repeated structure in the Logical View. This Data Element is declared only once in the Logical View. |
Code | Meaning |
---|---|
DEL-ER | Error on a Data Element |
IED | Maximum number of errors on the Logical View data that the Business Component can detect before the return to the Client. This number is determined by the DATAERR option. |
IER | Maximum number of errors on database accesses that the Business Component can detect before the return to the Client. This number is determined by the ACCESERR option. |
K50L | Work indicator of the number of Segment access errors |
K50D | Work indicator of the number of Data Element errors |
Code | Meaning |
---|---|
EE-view-LIBRA | Library |
EE-view-SERVER | Business Component |
EE-view-VIEW | Logical View |
EE-view-DATCOD | Data Element |
EE-view-DATERR | Error code |
EE-view-DATTYP | Error type:
|
EE-view-ICATR | Line number where the error is detected |
Code | Meaning |
---|---|
V-ERR-SEGCOD | Erroneous Segment |
V-ERR-SEGERR | Error code |
V-ERR-SEGTYP | Error type |
V-ERR-ICATR | Rank of the erroneous occurrence in a multi-occurrence processing |
V-ERR-LIBRA | Library |
V-ERR-SERVER | Business Component |
- The communication area is loaded,
- The Business Component is called and the communication area is passed on,
- The message is retrieved upon the return to the Business Component.
- Some fields must not be modified (Table 6)
- Some fields might be modified if necessary, under your own responsibility only (Table 7). As these fields are loaded in standard, it is recommended to use the intermediate fields that are described in the WORKING-STORAGE SECTION to modify them. You must not add new values or modify the existing values of these fields.
Code | Meaning |
---|---|
TECH-BUFFER | Technological buffer |
TECH-LGCOMM | Global length of the communication area that is passed by the Client |
TECH-LGTECH | Length of TECH-BUFFER |
TECH-LGUSER | Length of the user buffer. This buffer is optional. |
TECH-LGVIEW | Length of the Logical View to be processed. A Business Component can process several Logical Views, one at a time, and the length of each of them can differ. |
TECH-LGDESC | Length of the buffer for the action codes |
TECH-LGERR | Length of the buffer of errors on the Logical View |
TECH-STRUCT | Not used but it must be set to S by the Client |
Code | Meaning |
---|---|
TECH-CLIENT | Calling Client. It is not used for a graphical Client that calls Business Components in a synchronous mode. |
TECH-VIEW | Name of the Logical View to be processed |
TECH-SERVER | Name of the called Business Component |
TECH-OPER | Service that is requested by the Client on the
Logical View. It can have one of the following values:
|
TECH-LIBRA | Not used |
TECH-ICATRC | Number of instances to be processed by the Business Component on the Logical View |
TECH-ICATRS | Number of instances that are selected by the Business Component for a selection, check, or update service |
TECH-IERRS | Indicator of non-system errors on selection
access. It is set by the Business Component and can have the following
values:
|
TECH-IERRU | Indicator of non-system errors on check or update
access. It is set by the Business Component and can have the following
values:
|
TECH-IERRC | Indicator of non-system errors. It is set by
the Business Component and can have the following values:
|
TECH-IDATAC | Indicator for the check of the Logical View
data. It can have the following values:
|
TECH-ERRCOD | File status or SQLCODE in the case of a physical access error. It is set by the Business Component. |
TECH-CODE | Name of the file or the table where an unrecoverable error is detected. It is set by the Business Component. |
TECH-TYPE | File access type in the case of an unrecoverable error. It is set by the Business Component (for example R for read or W for write). |
TECH-LGREAL | Real length of the communication area. It is set by the Client and the Business Component. |
TECH-EXTNAM | Code of the extraction method. It is set by the Client. |
TECH-TRANS | Indicator for the beginning and end of the transaction.
It is set by the Client and can have the following values:
|
TECH-COMMIT | Indicator for the COMMIT request
from the Client:
|
TECH-LGDATA | Length of the indicator for the check of the Logical View data. It is set by the Client. |
TECH-NUVERS | Number of the version that is used for the compatibility check between the Business Component and the graphic Client |
TECH-BROWSE | Selection type indicator:
|
TECH-SRVUSR | User service that is initialized by the Client |
TECH-REQST | Management of the calling sequence of Business
Components after a client request:
|
TECH-CALSRV | Management of the opening and closing sequence
of the cursors upon a large reading for a selection of instances:
|
TECH-TIMEST | Timestamp management for a lock or unlock service |
TECH-FILL | Internal filler, reserved |
USER-BUFFER | Optional user buffer. This buffer is the same within a Dialog |
SELT-BUFFER | End-of-access buffer on a Segment in selection and in the repetitive category |
CONT-BUFFER | When no error is detected, this buffer contains the application data that must be conveyed as Logical Views between the Client and the Business Component. When an error is detected, this buffer is redefined by the ERR-BUFFER field. |
ERR-BUFFER | Error buffer that is divided into errors on Segments and errors on Data Elements |
PROCEDURE DIVISION
Function code | Function goal |
---|---|
05 FSERVER | Beginning of Server processing |
10 FSERVER-STRVIEW | Validation of the structure and length of the communication area buffers |
05 FSQL | SQL declaration |
10 FSQL-WHENEVER | WHENEVER clause |
10 FSQL-CURSR-segt | DECLARE CURSOR clause |
05 Fview | Processing of the view Logical View |
10 Fview-BEGV | Initialization of the Logical View processing |
10 Fview-CHUP | Check and update processing This processing is constituted of levels 15 Fview-CHUP-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). The
following processing is run:
|
10 Fview-LOCK | Lock |
10 Fview-UNLK | Unlock |
10 Fview-SELC | Selection processing This processing is constituted of levels 15 Fview-SELC-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). The
following processing is run:
|
10 Fview-USER | User processing |
10 Fview-ERRV | Error processing for the view Logical View |
10 Fview-ENDV | End of processing for the view Logical View |
05 FSERVER-END | End of Server processing. Return to the Client. |
Function code | Function goal |
---|---|
10 Fview-TRDT | Transfer of data from the Logical View to the
Segments for the physical accesses This processing is constituted of levels 15 Fview-TRDT-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). |
10 Fview-CHKD | Check of the Logical View data This processing is constituted of levels 15 Fview-CHKD-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). |
10 Fview-TRVW | Transfer of data from the Segments to the Logical
View for the physical accesses This processing is constituted of levels 15 Fview-TRVW-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). |
10 Fsegt-CHCK | Processing of the logical accesses for check
on Segment segt This processing is constituted of levels 15 Fsegt-CHCK-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). The
following processing is run:
|
10 Fsegt-UPDT | Processing of the logical accesses for update
on Segment segt This processing is constituted of levels 15 Fsegt-UPDT-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). The
following processing is run:
|
10 Fsegt-SLCT | Processing of the logical accesses for selection
on Segment segt This processing is constituted of levels 15 Fsegt-SLCT-CATX for the processing of category X. The category can be A (before the repetitive category), R (repetitive category), or Z (after the repetitive category). The
following processing is run:
|
F80 | Physical accesses that are run by PERFORM from
the logical accesses and that are generated in function 80.
This function includes the following processing:
|
F81 | Additional processing that is run by PERFORM and
that is generated in function 81. This function includes
the following processing:
Function F81 also includes the retrieval of errors. The corresponding subfunctions vary according to the persistent data storage structure. |