Server call in a Business Component
In the -CS Lines tab of a Server or Server Dialog with a Business Component type, you can call another Business Component to run a service. You must specify the name of the first Logical View that sends the service call to the first-level Business Component. You must also indicate the call to the second-level Logical View by its name in the first-level Business Component, and the service call to the second-level Business Component.
For example, you can call a second-level Business Component to manage a user service. A user service is entirely described with specific code. For example, it can count the number of customers per day who issue an order. It is described with specific code. To reuse the user service in other Business Components, you can then dedicate a Business Component to the user service and call it from other Business Components. To call a user service, you call the ££USER protected Macro in the Business Component -CP Lines.
- Only one Server call line is possible.
- Only the fields Server, Segment (Logical View or Segment name in the repository), Segment code (Logical View or Segment name in the Server) can be entered.
- The Organization is always 2: Instance by instance Business Component call.
- The Description type is always 1: Database Segment.
The fields are explained according to the order of their display in the CS Line - Server call definition section.
- Segment
- Specify the name of the Segment in the repository. To do so, click
Change. A selection wizard opens with the Segments that can be selected.
Select or create a Segment and click OK. In the table, it is displayed in the
Seg / LV column.
You can also specify the Segment directly from the Seg / LV column.
Two methods are possible:- Place the cursor in the column and enter the name directly. To make the input easier, you can open a content assist wizard by clicking Ctrl and the space bar simultaneously. If you start entering a name, the content assist displays the instances that start with this input. If you enter the name of an instance that does not exist and if you validate, the input is discarded.
- Click the button that appears when you set your cursor in the column. In the selection wizard that opens, select an instance.
- Server
- Specify a second-level Server in the Business Component. To do so, click
Change. A selection wizard opens with the Servers that can be selected.
Select or create a Server and click OK. In the table, it is displayed in the
Server column.
You can also specify the Server directly from the Server column.
Two methods are possible:- Place the cursor in the column and enter the name directly. To make the input easier, you can open a content assist wizard by clicking Ctrl and the space bar simultaneously. If you start entering a name, the content assist displays the instances that start with this input. If you enter the name of an instance that does not exist and if you validate, the input is discarded.
- Click the button that appears when you set your cursor in the column. In the selection wizard that opens, select an instance.
Id
- Category
- This field indicates the category where the Segment is processed. The categories and the
Segments that they contain are processed in the following order:
- Blank: Top category
- R: Repetitive category
- Z: Bottom category
- Segment code
- It is required. It corresponds to the Segment or Logical View name in the COBOL code of the Business Component. It can be different from the name that is stored in the repository. Its value is displayed in the Name column of the table.
- Line number
- This field is numeric. Only one 00 line number (default) is authorized in a Segment. This 00 line is required to enter the physical characteristics of the Segment (external name, organization), the name of the Segment access key, and the Segment code in the repository.
Access key filling
- Previous Segment code
- Enter the Segment that is to be accessed before the Segment code in the program (see the Segment code field in the Id panel). Several Segments can be accessed in each category. Therefore, you can indicate a hierarchy to access the Segments of a category. This field contains the previous Segment in the access hierarchy. This Segment must belong to the same category. If several Segments have the same previous Segment, they are processed alphabetically.
- Each Segment must be linked directly or indirectly to the Logical View that it depends on. It
must include the code of a previous Segment or of its Logical View (S
organization).Exception: The Segment that is dedicated to the error messages must not include the previous Segment. A Logical View cannot have a previous Segment.
- Reception
- You specify the way that the Segment is used in the validation and update processing. Select an
option in the list.
Table 1. Values of the use of a Segment in the validation and update processing Options Description No value or N: Not used For an organization different from X, S, and 2, no access is generated for this Segment in the validation and update processing (default). For a 2 or X organization, no Server call is generated.
L: Read For an organization different from X, S, and 2, a simple read command is generated for the Segment. For a 2 or X organization, a Server is called for selection.
E: Existence validation For an organization different from X, S, and 2, an existence validation is run. A read command with the setting of an error code is generated (if it is not found). For a 2 or X organization, a Server is called for validation.
M: Update (modification) For an organization different from X, S, and 2, the Segment is updated (modification only). For a 2 or X organization, a Server is called for validation and update.
X: Update (creation and modification) For an organization different from X, S, and 2, the Segment is updated (creation and modification only). For a 2 or X organization, a Server is called for validation and selection.
S: Update Segment (deletion only) For an organization different from X, X, S, and 2, the Segment is updated (deletion only). C: Update Segment (creation only) For an organization different from X, X, S, and 2, the Segment is updated (creation only). T: Update (creation, modification, and deletion) For an organization different from X, S, and 2, the Segment is updated (creation, modification, and deletion). In these cases, the existence validations and the update statements that correspond to the selected options are generated. If the Segment is related to a previous Segment, regardless of the indicated use, only the update commands for modification and creation are generated.
For a 2 or X organization, a Server is called for validation, update, and selection.
U: Call of a user service For a 2 or X organization, a user service is called.
- Display
- You specify the way that the Segment is used in the display processing. Select an option in the
list.
Table 2. Values of the use of a Segment in display Options Description No value or N: Nor used For an organization different fromX, S, and 2, no access is generated for the Segment in the display processing (default option). For a 2 or X organization, no Server call is generated.
A: Used in display For an organization different fromX, S, and 2, the access is generated for the display according to the type of logical access processing. If the previous Segment code is blank and the Segment is used, the key is saved in the conversation area. For a 2 or X organization, a Server is called for selection (not compatible with the L value in reception).
U: Call of a user service For a 2 or X organization, a user service is called.
- Access key source
- This field can be used as a working area (ww10-delco for example) or a
literal (02 for example).Note: The key loading for the lists must always be performed from the 1- area in the Servers if the key is in the repetitive category of the Logical View.
A free reference is set when you indicate a Data Element in this field.
Content assist is available on this field, as shown by the symbol
in front of the field. To activate it, press Ctrl+Space. A subreference link is automatically created, even if the instance does not exist. From the target instance in the subreference results, you can start a super reference search.
If you put the cursor from the first to the fourth position of the field, the content assist wizard first displays the list of Segments. Select one of them, then click the field again and press Ctrl+Space again. The content assist then displays the list of Data Elements. Select one of them.
Primary access key
You select a Data Element or you enter the name of a new Data Element that is to be used as the primary access key to the Segment. It is used to generate the RECORD KEY clause. For a VSAM file (V organization), it must be entered on the Segment 00 line. The Data Element that is specified in this field is considered as a group Data Element, except for SQL organizations where it is considered as an elementary Data Element.
- Data Element
- Specify the Data Element that is used as an access key to the Segment. You can select a Data
Element or change the called Data Element by clicking Change. A selection
wizard opens with the Data Elements that are called in the Segment. Select one of the Data Elements
and click OK. In the table, it is displayed in the Access
key column.
You can also specify the Data Element directly from the Access key column.
Two methods are possible:- Place the cursor in the column and enter the name directly. To make the input easier, you can open a content assist wizard by clicking Ctrl and the space bar simultaneously. If you start entering a name, the content assist displays the instances that start with this input. If you enter the name of an instance that does not exist and if you validate, the input is discarded.
- Click the button that appears when you set your cursor in the column. In the selection wizard that opens, select an instance.
- Undefined Data Element
- If the primary access key is a group Data Element, and if different values are given to the individual members of that group, enter the elementary Data Elements of the group in the Undefined Data Element field.
For a Table (G organization), you select a subsystem by indicating the value NUSSY in this field. The associated key (G-ddss-NUSSY) is generated.
For SQL database Segments, a key element must be entered on each line where the value of the Display field is not N.
In generated access level, the Segments are selected when the keys are equal for an update or a direct read. For a sequential read in the repetitive category, the Segments are selected when their keys are equal or greater.
A Segment cannot contain more than 10 key Data Elements.
If the error message Segment is an SQL/DS Segment or if it has a V or W organization, the Data Element key must be ERKEY.
Logical characteristics
- Generation limitation
- In the list, select the generation limitation of the logical accesses to Segments.
- Automatic.
The logical access is generated automatically, according to the use of the Segment.
- U: User-defined Segment.
The Segment access is described by the user (organization different from S).
- P: No description of Segment.
The Segment access is not described (organization different from S).
- Automatic.
- Control break
- You can indicate that a Data Element that belongs to the key in the repetitive part must remain
constant upon the display or selection of a list. Only the records that have this key value are
kept. You must then specify a control break.
Table 3. Possible values for the control break. Options Description No control break No control break is specified for the display or the selection. C: display break A control break is specified for the display or the selection. E: display break (SQL) For an SQL organization, it is a display control break. It generates an equal condition in the WHERE clause of the SQL DECLARE CURSOR statement. It replaces >=, which is generated otherwise. R: Large reading of the Folder (Server only) This option is available with Segments whose organization is H, D, or V. It must be selected to specify a large reading, such as the display of all the lines of all the orders, for each Segment that is associated with the Logical View. You must select the value R on each key Data Element that corresponds to a key Data Element of the Logical View. The Logical View must belong to the Folder root node if a Folder is implemented.
- Subschema
- This field is used with the Pactables function to indicate which subschema is to be described.
You must select either All Data Elements or a description from 0 to 9. The
value 0 corresponds to subschema 10. A subschema is a group of Data Elements that are present in the
Segment composition.
- For the G-type (Table) or H-type (relational database) organizations, this field indicates the number of the Table subdescription or subschema that the input/output area description corresponds to. If the called Segment corresponds to a view and no subschema is specified, the value is specified on the Block -DR Lines.
- For the V-type (indexed) organization, you use this field to specify the
secondary access keys to indexed files:
- The secondary key is specified with the value 2. The primary key must be indicated on the 00 line of the Segment without a use in display or reception, even if it is not used, to generate the RECORD KEY clause. If the secondary key is a group field, the number of the subschema must be indicated for this group area only.
- The value 3 indicates that the secondary key is
DUPLICATE.Note: This specification is not implemented in the CICS® variant because the declaration of the secondary keys is performed in the VSAM definition.
- Generate level
- Not used for a Business Component.
Physical characteristics
- Organization
- X: Global call of the Business Component.
The first-level Business Component runs service calls and acts like a client. Its function can be considered like a branching point to the second-level Business Components that run the requested service. The second-level Business Component is called only once for all the instances.
- 2: Instance by instance Business Component call. The second-level Business Component is called for each instance. Business Components are then called as Servers that complement the first-level Business Component. As a result, a service can call Business Components and data access Segments.Note: With this type of call, a TUI application can work in Folder mode. The TUI client makes a service call to an aggregated Logical View that contains a number of Logical Views. The service is run by a first-level Business Component whose role is to call, for each instance of the aggregated Logical View, the Business Components that are associated with the other Logical Views.
- X: Global call of the Business Component.
- Description type
- The Description type field contains values that generate, from the Segment description in the repository, different descriptions in the generated COBOL code. The following values can be selected:
- Conventional (fixed) (default value) for a Segment that might have a specific part. For example, it can be a Data Structure with a Segment.
- 1: Database Segments for a Segment without any common part. For example, it can be, for a database, various Segments that are defined in the same Data Structure.
- E: Table type for Table-type Segments. The input format of the Data Elements that are called in the Segment is taken into account.
- 2 : Conventional (variable) for a complete Segment with a variable length for an indexed organization (V). The generated description can vary according to the generation variant.
- External name
- Enter the code of the Business Component.