34 Create User Defined PDL

This chapter contains the topic:

34.1 Creating User Defined PDL

You attach *PROCs to either a master file field or to a device file field (screen or report). If you attach them to a master file field, then the system places the code it generates in S005. If you attach them to a device file field, then the system places the code it generates in S004.

The purpose of User Defined PDL Entry Points is to allow you to create *PROCs in any subroutine and to allow them to exist without attaching them to a master file field or device file field. You define the entry points within subroutines where you enter PDL code using the Detailed Programming Facility. User Defined PDL Entry Points are a functional directive that you can enter into a primary logic module.

The User Defined PDL Entry Points cause the system to create RPG code in the same manner as users entering the PDL using the Detailed Programming Facility; however, you connect it to logic modules instead of fields.

In any primary logic module you can insert up to 99 PDL directives. Ordinarily, you number the first one PDL01, the second one PDL02, and so forth. PDL directives do not have to be in sequential order; however, each PDL directive must have a unique number within that logic module.

For all single record maintenance forms, you create a user defined PDL entry point in the mainline subroutine. Enter PDL to bring in a default value for a constant field.

For example, change the logic module MAINLINE because this module creates the mainline code for all single record maintenance forms.

Before You Begin

You must be able to locate program types and logic modules. See Section 30.4, "Creating or Modifying Program Types" and Chapter 31, "Work with Logic Modules."

To create user defined PDL

Navigation

From Model Program Design Menu (G9361), under LOGIC MODULES, choose Create/Modify

  1. On Create/Modify (Logic Module), access the Edit screen.

    Figure 34-1 Create/Modify (User Defined PDL) screen

    Description of Figure 34-1 follows
    Description of "Figure 34-1 Create/Modify (User Defined PDL) screen"

  2. On the Edit screen, create the user defined PDL entry points within the affected primary logic modules.

    The naming convention for user defined PDL entry points is PDLxx, where xx is a two digit number between 01 and 99.

    You can either add the PDL directive to an existing line of code that does not contain a directive, or insert a new line and enter the directive on this line. The directive goes in positions 1 to 5 of the source line. If you insert a new line, remember to add the source sequence and serial number in the appropriate columns. (Move to column 80.)

    In this example, you enter PDL01 on line 9. Any PDL code that you enter for this entry point will come immediately after the statement EXSR S999 and before the test for *INLR.

    Figure 34-2 Edit PDL Code screen

    Description of Figure 34-2 follows
    Description of "Figure 34-2 Edit PDL Code screen"

  3. Access the Software Versions Repository and locate the member.

    Figure 34-3 Software Versions Repository (User Defined PDL) screen

    Description of Figure 34-3 follows
    Description of "Figure 34-3 Software Versions Repository (User Defined PDL) screen"

  4. Enter 10 (Design) next to the environment in the Option field:

    The Program Generator Specification screen displays.

    Figure 34-4 Define Generator Specification (User Defined PDL) screen

    Description of Figure 34-4 follows
    Description of "Figure 34-4 Define Generator Specification (User Defined PDL) screen"

  5. On Define Generator Specification, enter 1 in the Option field to access the Detailed Programming Facility:

    The Detailed Programming Facility screen displays.

    Figure 34-5 Detailed Programming Facility (User Defined PDL) screen

    Description of Figure 34-5 follows
    Description of "Figure 34-5 Detailed Programming Facility (User Defined PDL) screen"

  6. Enter the PDL code through the Detailed Programming Facility.

    All user defined PDL entry points appear after the form or report file fields in the Detailed Programming Facility.

  7. On Detailed Programming Facility, enter 6 in the Option field to access Data Item Formula Revisions.

  8. Enter the PDL code.

    Figure 34-6 Data Item Formula Revisions (User Defined PDL) screen

    Description of Figure 34-6 follows
    Description of "Figure 34-6 Data Item Formula Revisions (User Defined PDL) screen"