Micropattern for the implementation of customized SQL access types
If SQL access types are customized in the -GG Lines of a Segment, you can then decide to implement them or to ignore them in the Program, Screen, or Business Component that calls this Segment. To do so, you must use the SQL micropattern.
Implementation in Programs
Customized access types can be implemented only if the Program -CD Lines contain a Block code in the External name field and an organization in the Organization field.
You must explicitly call each customized access type that you want to generate in the Program.
To manage the implementation of the SQL access types in a Program, open the Program COBOL code with the PDP COBOL editor. Then, enter the SQL micropattern and its parameters.
- *! is the required start tag of the micropattern. The
* must be entered in column 7, reserved for the comments in the COBOL code, and the
! must be entered in column 8.Note: If you press CTRL + space bar in the PDP COBOL editor, the content assist facility displays the list of the micropatterns that are adapted to the entity and to the position in the COBOL code (WORKING-STORAGE SECTION or PROCEDURE DIVISION). The micropatterns that are used only to retrieve the Pacbase data are not included in the list. Each micropattern in the list is documented. If you double-click one of them, the start tag and the identifier of the micropattern are inserted in the code. You must then complete its declaration.
- SQL is the micropattern identifier. It is required.
- " " must frame the operands.
- The Segment code in the Program is required (SGPG for example).
- The Segment code in the repository must be indicated if it is different from the Segment code in the Program (SS00 for example).
- The access type is required.
- If you specify the standard access code before the nonstandard access code, the customization of the nonstandard access complements the standard access.
- If you specify only the nonstandard access code without specifying a standard access code, the customization of the nonstandard access is implemented. It constitutes a user function unknown to the generator. You must then describe and manage it with specific code.
*!SQL "SGPG SS00 R"
*!SQL "SGPG SS00 R R1"
Implementation in Screens or Business Components
The customized SQL access types are recognized in standard Screens if the PACSQL option is indicated in the Dialog Complement tab, or in the Dialog or Screen -GO Lines.
All the access types are generated in function 80.
Customized standard access types are automatically generated with the customization that is entered on the Segment -GG Lines. If you want to ignore the customization of standard access types, you must specify it in the COBOL code of the Screen or Business Component.
To implement nonstandard access types, you must call them explicitly in the COBOL code of the Screen or Business Component.
To manage the implementation of the SQL access types in a Screen or Business Component, open its COBOL code with the PDP COBOL editor. Create a subfunction of function 80. Enter the SQL micropattern and its parameters.
- *! is the required start tag of the micropattern. The
* must be entered in column 7, reserved for the comments in the COBOL code, and the
! must be entered in column 8.Note: If you press CTRL + space bar in the PDP COBOL editor, the content assist facility displays the list of the micropatterns that are adapted to the entity and to the position in the COBOL code (WORKING-STORAGE SECTION or PROCEDURE DIVISION). The micropatterns that are used only to retrieve the Pacbase data are not included in the list. Each micropattern in the list is documented. If you double-click one of them, the start tag and the identifier of the micropattern are inserted in the code. You must then complete its declaration.
- SQL is the micropattern identifier. It is required.
- " " must frame the operands.
- SS00 is the Segment. It is required.
- To ignore the customization of a standard access type, you must enter the standard access code
after the Segment code.Figure 3. In this example, the customization of the standard select access that is indicated in Segment SS00 is ignored.
*!SQL "SS00 R"
- To implement a nonstandard access type, you have three possibilities:
- If you enter the standard access code before the nonstandard access code, the customization of
the nonstandard access is generated in the standard processing of function 80.Figure 4. In this example, the nonstandard select access that is indicated in Segment SS00 is implemented. The automatically generated read processing of Segment SS00 is complemented by the lines that correspond to the R1 select access.
*!SQL "SS00 R R1"
- If you enter the nonstandard access code alone (without specifying any standard access code),
the customization of the nonstandard access type is generated in a specific subfunction of function
80. It then constitutes a user function unknown to the generator. So, you must
describe and manage it in specific code.Figure 5. In this example, the nonstandard select access that is indicated in Segment SS00 is implemented. The lines that correspond to R1 are generated in a specific subfunction F80-SS00-R1.
*!SQL "SS00 R1"
- If you enter the nonstandard access code followed by the = sign and the
standard access code, the customization of the nonstandard access is complemented by the processing
that is automatically generated for the specified standard access in function 80.Figure 6. In this example, the nonstandard select access that is indicated in Segment SS00 is complemented by the processing that is automatically generated for the standard select access.
*!SQL "SS00 R1=R"
Note: You must separate each operand with one space. You must enter the access codes on two positions if they are on one character (D, P, R, W) and if they are redefined and customized.Note: To implement the customized access types of an extraction method, you must call the ££80EX protected Macro in the Business Component -CP Lines and specify the values of its parameters. - If you enter the standard access code before the nonstandard access code, the customization of
the nonstandard access is generated in the standard processing of function 80.