23 Program Structure

This chapter contains these topics:

23.1 About Program Structure

The JD Edwards World program generator produces several types of programs:

23.1.1 Internal RPG Subroutines within JD Edwards World Programs

Standard subfile names make program maintenance easier. The system calls these subfles primarily from the Mainline.

JD Edwards World program structure uses several types of subroutines, including:

Name Description
S00EX Processes all function key exits.
  • Calls J96012 if F24 was pressed

  • Calls X96CCX if F1 was pressed

  • Calls subroutine S00VL if F1 was pressed after X96CCX was called

  • Calls P0000E if F7 was pressed

  • Calls P00HELP if the HELP key was pressed

  • Calls subroutine S001 if F22 was pressed

  • Calls all programs to process all user defined function keys

S00VL Values returned with Cursor Sensitive Help.

Is called from the subroutine S00EX after the program X96CCX is called

S00OP Subfile Selection Exits (Options)
S001 Clears all database and form fields.
  • Usually only clears key fields and VC0 fields if F22 (Clear) is pressed

S002 Checks for level breaks for reports.
  • Turns on level break flags.

  • Retrieves total line description

S003 Validates the key fields.

Calls S998 subroutine if auto inquire was invoked

Sets the file pointer.

  • Performs a SETLL or CHAIN if a single record maintenance program

  • Performs a SETLL for subfile programs

Calls a subroutine S004 to load form or report fields

Monitors for no subfile records loaded if a subfile

Loads unused subfile records with blanks

S004 Display or load form or report fields.
S005 Scrubs and edits form fields.
  • Moves screen data to database fields

  • Turns on error indicators if a field is in error

  • Updates or writes records to the database file if a subfile

  • Updates the subfile

S010 For reports with level breaks it:
  • Prints the total

  • Clears the level break totals

  • Prints the grand total (if it has reached the end of the file)

  • Prints the detail

  • Adds to the new level break totals

  • Calls subroutine S020 if it is a report with subheadings

If it is not a report, it updates, adds, or deletes records from the database file

  • Turns on F22 (Clear) to force S001 to be executed to clear the buffer before reading another record.

S020 Print Report Subheadings.
S998 Loads Data Dictionary values. (One time only)

Retrieves row description for level breaks and subheadings, if applicable

S999 Housekeeping. (One time only)
  • Sets auto inquiry

  • Defines key lists

  • Retrieves processing options and level breaks, if applicable

  • Retrieves vocabulary overrides

  • Loads error messages

  • Performs file opens

  • Current date retrieval

  • Work fields defined using *LIKE

  • Prints cover page and Helps in a report


Interactive Non-Subfile Program

Figure 23-1 Interactive Non-Subfile Program

Description of Figure 23-1 follows
Description of "Figure 23-1 Interactive Non-Subfile Program"

Subfile Program with Selection Exits

Figure 23-2 Subfile Program with Selection Exits

Description of Figure 23-2 follows
Description of "Figure 23-2 Subfile Program with Selection Exits"

Report Program without Subheadings

Figure 23-3 Report Program without Subheadings

Description of Figure 23-3 follows
Description of "Figure 23-3 Report Program without Subheadings"

Report Program with Subheadings

Figure 23-4 Report Program with Subheadings

Description of Figure 23-4 follows
Description of "Figure 23-4 Report Program with Subheadings"

23.1.2 Review an RPG Program's Source

The following pages illustrate a maintenance program without a subfile.

Some of the more important areas and commonly used fields are highlighted and explained.

Figure 23-5 Maintenance Program without a Subfile (part 1)

Description of Figure 23-5 follows
Description of "Figure 23-5 Maintenance Program without a Subfile (part 1)"

Figure 23-6 Maintenance Program without a Subfile (part 2)

Description of Figure 23-6 follows
Description of "Figure 23-6 Maintenance Program without a Subfile (part 2)"

Figure 23-7 Maintenance Program without a Subfile (part 3)

Description of Figure 23-7 follows
Description of "Figure 23-7 Maintenance Program without a Subfile (part 3)"

Figure 23-8 Maintenance Program without a Subfile (part 4)

Description of Figure 23-8 follows
Description of "Figure 23-8 Maintenance Program without a Subfile (part 4)"

Figure 23-9 Maintenance Program without a Subfile (part 5)

Description of Figure 23-9 follows
Description of "Figure 23-9 Maintenance Program without a Subfile (part 5)"

Figure 23-10 Maintenance Program without a Subfile (part 6)

Description of Figure 23-10 follows
Description of "Figure 23-10 Maintenance Program without a Subfile (part 6)"

Figure 23-11 Maintenance Program without a Subfile (part 7)

Description of Figure 23-11 follows
Description of "Figure 23-11 Maintenance Program without a Subfile (part 7)"

Figure 23-12 Maintenance Program without a Subfile (part 8)

Description of Figure 23-12 follows
Description of "Figure 23-12 Maintenance Program without a Subfile (part 8)"

Figure 23-13 Maintenance Program without a Subfile (part 9)

Description of Figure 23-13 follows
Description of "Figure 23-13 Maintenance Program without a Subfile (part 9)"

Figure 23-14 Maintenance Program without a Subfile (part 10)

Description of Figure 23-14 follows
Description of "Figure 23-14 Maintenance Program without a Subfile (part 10)"

Figure 23-15 Maintenance Program without a Subfile (part 11)

Description of Figure 23-15 follows
Description of "Figure 23-15 Maintenance Program without a Subfile (part 11)"

Figure 23-16 Maintenance Program without a Subfile (part 12)

Description of Figure 23-16 follows
Description of "Figure 23-16 Maintenance Program without a Subfile (part 12)"

Figure 23-17 Maintenance Program without a Subfile (part 13)

Description of Figure 23-17 follows
Description of "Figure 23-17 Maintenance Program without a Subfile (part 13)"

Figure 23-18 Maintenance Program without a Subfile (part 14)

Description of Figure 23-18 follows
Description of "Figure 23-18 Maintenance Program without a Subfile (part 14)"

Figure 23-19 Maintenance Program without a Subfile (part 15)

Description of Figure 23-19 follows
Description of "Figure 23-19 Maintenance Program without a Subfile (part 15)"

Figure 23-20 Maintenance Program without a Subfile (part 16)

Description of Figure 23-20 follows
Description of "Figure 23-20 Maintenance Program without a Subfile (part 16)"

Figure 23-21 Maintenance Program without a Subfile (part 17)

Description of Figure 23-21 follows
Description of "Figure 23-21 Maintenance Program without a Subfile (part 17)"

Figure 23-22 Maintenance Program without a Subfile (part 18)

Description of Figure 23-22 follows
Description of "Figure 23-22 Maintenance Program without a Subfile (part 18)"

Figure 23-23 Maintenance Program without a Subfile (part 19)

Description of Figure 23-23 follows
Description of "Figure 23-23 Maintenance Program without a Subfile (part 19)"

Figure 23-24 Maintenance Program without a Subfile (part 20)

Description of Figure 23-24 follows
Description of "Figure 23-24 Maintenance Program without a Subfile (part 20)"

Figure 23-25 Maintenance Program without a Subfile (part 21)

Description of Figure 23-25 follows
Description of "Figure 23-25 Maintenance Program without a Subfile (part 21)"

Figure 23-26 Maintenance Program without a Subfile (part 22)

Description of Figure 23-26 follows
Description of "Figure 23-26 Maintenance Program without a Subfile (part 22)"

Figure 23-27 Maintenance Program without a Subfile (part 23)

Description of Figure 23-27 follows
Description of "Figure 23-27 Maintenance Program without a Subfile (part 23)"

Figure 23-28 Maintenance Program without a Subfile (part 24)

Description of Figure 23-28 follows
Description of "Figure 23-28 Maintenance Program without a Subfile (part 24)"

Figure 23-29 Maintenance Program without a Subfile (part 25)

Description of Figure 23-29 follows
Description of "Figure 23-29 Maintenance Program without a Subfile (part 25)"

Figure 23-30 Maintenance Program without a Subfile (part 26)

Description of Figure 23-30 follows
Description of "Figure 23-30 Maintenance Program without a Subfile (part 26)"

Figure 23-31 Maintenance Program without a Subfile (part 27)

Description of Figure 23-31 follows
Description of "Figure 23-31 Maintenance Program without a Subfile (part 27)"

Figure 23-32 Maintenance Program without a Subfile (part 28)

Description of Figure 23-32 follows
Description of "Figure 23-32 Maintenance Program without a Subfile (part 28)"

Figure 23-33 Maintenance Program without a Subfile (part 29)

Description of Figure 23-33 follows
Description of "Figure 23-33 Maintenance Program without a Subfile (part 29)"

Figure 23-34 Maintenance Program without a Subfile (part 30)

Description of Figure 23-34 follows
Description of "Figure 23-34 Maintenance Program without a Subfile (part 30)"

Figure 23-35 Maintenance Program without a Subfile (part 31)

Description of Figure 23-35 follows
Description of "Figure 23-35 Maintenance Program without a Subfile (part 31)"

Figure 23-36 Maintenance Program without a Subfile (part 32)

Description of Figure 23-36 follows
Description of "Figure 23-36 Maintenance Program without a Subfile (part 32)"