Micropattern for the implementation of customized SQL access types

If SQL access types have been customized in the -GG Lines of a Segment, you can then decide to implement them or to ignore them in the Program or standard Screen 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.

You must respect the following syntax:
  • *! 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.
  • 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 will complement the standard access.
    • If you specify only the nonstandard access code without specifying a standard access code, the customization of the nonstandard access will be implemented. It will constitute a user function unknown to the generator. You will have to describe and manage it with specific code.
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.
Figure 1. In this example, the customization of the standard select access that is indicated in Segment SS00 will be implemented:
*!SQL "SGPG SS00 R"
Figure 2. In this example, the customization of the nonstandard select access that is indicated in Segment SS00 will be implemented:
*!SQL "SGPG SS00 R  R1"
Important: To implement the multirow function, you must specify the MULTIROW=ssss,xxx option in the -GO Lines of the calling Program. (ssss is a Segment and xxx is the maximum index).

Implementation in standard Screens

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 F80.

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 Screen COBOL code.

To implement nonstandard access types, you must call them explicitly in the Screen COBOL code.

Note: Standard access types are ignored for organizations R (SQL RDMS) and 2 (DB2 without generated access) but you can request the implementation of nonstandard access types.

To manage the implementation of the SQL access types in a standard Screen, open the Screen COBOL code with the PDP COBOL editor. Then, enter the SQL micropattern and its parameters.

The syntax must start with the following elements:
  • *! 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.
  • SQL is the micropattern identifier. It is required.
  • " " must frame the operands.
  • SS00 is the Segment. It is required.
The continuation of the syntax depends on how you want to implement the customized access type that is indicated in the Segment -GG Lines:
  • 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 will be 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 will be generated in the standard processing of function F80.
      Figure 4. In this example, the nonstandard select access that is indicated in Segment SS00 will be implemented. The automatically generated read processing of Segment SS00 will be 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 will be generated in a specific subfunction of function F80. It will then constitute a user function unknown to the generator. So, you will have to describe and manage it in specific code.
      Figure 5. In this example, the nonstandard select access that is indicated in Segment SS00 will be implemented. The lines that correspond to R1 will be 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 will be complemented by the processing that is automatically generated for the specified standard access in function F80.
      Figure 6. In this example, the nonstandard select access that is indicated in Segment SS00 will be 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.

Feedback