Insertion relative to the 05 hierarchical level in a Business Component
You can insert specific processing or replace standard processing in the generated blocks. These blocks have a 05 hierarchical level. These blocks are the Business Component initialization and end blocks, the SQL declarations block, and the Logical View blocks. The block and the action type that you select indicate where the specific processing is to be inserted.
You can declare or replace a specific processing in the Business Component. If the specific processing applies to the Logical View block, you must identify the impacted Logical View. The instructions must be written on hierarchically lower levels.
All these insertions are identified by ACTION=*C in the Macro code.
In the Business Component code, they start with an annotation that corresponds to the selected action type.
- Blocks
- The following blocks are generated with a 05 hierarchical
level:
- Business Component initialization.
This block retrieves the information that is contained in the communication area and carries out initializations. It corresponds to the FSERVER block in the code.
In the Macro code, the insertion relative to this type of block is identified by REF=BS.In the Business Component code, the insertion relative to this type of block is identified by BS, after the annotation for the relative position (*@BEFORE, *@AFTER, or *@REPLACE).
- Logical View.
If several Logical Views are declared in the Business Component, there are as many blocks as Logical Views. In the Segment code field, you must enter or select the Logical View type Segment where you want to insert or replace a processing. The function that you associate with the selected Logical View is not created in the COBOL code. It indicates that all its subfunctions will be attached to the selected Logical View, to avoid specifying it on all the subfunctions.
In the Macro code, the insertion relative to this type of block is identified by REF=view, where view is the Logical View.
In the Business Component code, the insertion relative to this type of block is identified by Fff=view x, where Fff is the function, view is the Logical View and x the action type if it was selected (A (ante) for Insert before, P for Insert after, and R pour Replace). The insertion always starts with *@ATTACH and is displayed at the beginning of the PROCEDURE DIVISION.
- Business Component end.
This block returns the information to the client. It corresponds to the FSERVER-END block in the code.
In the Macro code, the insertion relative to this type of block is identified by REF=ES.
In the Business Component code, the insertion relative to this type of block is identified by ES, after the annotation for the relative position (*@BEFORE, *@AFTER, or *@REPLACE).
- SQL cursors declarations.
This block describes the clauses that are required for the SQL declarations. It corresponds to the FSQL block in the code.
You can insert specific processing at two levels:- Relatively to the FSQL block itself.
- Relatively to a specific function that you attach to the FSQL block. You describe the instructions in subfunctions of this function.
In the Macro code, the insertion relative to this type of block is identified by REF=SQ.
In the Business Component code, the insertion relative to this type of block is identified by Fnn=SQ (where Fff is the function).- It is preceded by *@ATTACH and is located at the beginning of the PROCEDURE DIVISION to indicate the attachment of a specific function to the FSQL block. The function that you indicate is not created in the COBOL code.
- It is preceded by the annotation for a relative position (*@BEFORE, *@AFTER, or *@REPLACE) for the insertion of a specific function in the FSQL block. The function is then created in the COBOL code.
- Business Component initialization.
- Action type
- Specific processing is inserted in a Business
Component relatively to the standard generated processing. You can
then benefit from the generated processing and adapt it to your needs.
To add a specific processing, you must then insert the processing relatively to a standard processing of the block that you select in the Block field. You must select one of the following options to insert the specific processing:
- Insert before a standard processing. The specific processing is inserted
before the start tag of the standard processing.
In the Macro code, the positioning of this specific processing is identified by the letter A after the block code (REF=BS A for example). In the Business Component code, it is identified by *@BEFORE after the block code.
- Insert after a standard processing. The specific processing is inserted
before the end tag if the hierarchical level is greater than the level of the standard processing.
It is generated after the end tag if the hierarchical level is identical to the level of the
standard processing.
In the Macro code, the positioning of this specific processing is identified by the letter P after the block code in the Macro code (REF=BS P for example). In the Business Component code, it is identified by *@AFTER after the block code.
- Replace a standard processing.
In the Macro code, the positioning of this specific processing is identified by the letter R after the block code in the Macro code (REF=BS R for example). In the Business Component code, it is identified by *@REPLACE after the block code.
- None. This option is specific to an insertion in the Logical
View block or the SQL cursors declarations block. It is used to
attach a function to one of these blocks so that all the subfunctions of this function can
automatically recognize this attachment.
In the Macro code, the positioning of this specific processing is not identified by any letter. In the Business Component code, it is identified by a COBOL comment line at the beginning of the PROCEDURE DIVISION. This comment includes the *@ATTACH tag (for example *@ATTACH F03=SQ, where F03 is the specific function that is associated with the FSQL function).
- Insert before a standard processing. The specific processing is inserted
before the start tag of the standard processing.