Adding Sections

This section provides an overview of sections and discusses how to:

  • Insert sections.

  • Locate sections.

  • Set section properties.

A section comprises steps and is similar to a COBOL paragraph or a PeopleCode function. You can create sections that are platform-independent or platform-specific, intended for a particular market, and effective-dated.

Whenever you create a new program, you simultaneously create a section called MAIN. The MAIN section identifies the entry point of the program so that it can be called by another program.

Section Execution Order

A section is unique based on program and section names, and based on its intended database platform and effective date. When you execute an Application Engine program, it executes sections based on the following order of precedence:

  1. If a section for the current market exists, then run it.

    Otherwise, execute the default GBL (global) market section.

  2. If a section for the current platform, or database exists, execute it.

    Otherwise, execute the default database platform section.

  3. If multiple effective-dated sections exist, execute the section with the most recent effective date based on the current (run) date.

For example, suppose you have two versions of a particular section, SECT01 for the Public Sector market and SECT01 for the Global market. If you request to run the public sector version of the program, Application Engine executes the Public Sector version of SECT01. If the program is running on Oracle, Application Engine then looks for an Oracle version of SECT01 for Public Sector.

To insert a section:

  1. Select Insert, Section, or right-click and select Insert Section.

    The default name for a section that you insert is Section N, where N is an incremental number intended to provide a unique name for each section object. Unless you rename sections, the sections you add are named SectionN+1, where N is the last section you inserted. Consequently, the names are Section1, Section2, Section3, and so on.

    The designer inserts the new section directly beneath the subordinate objects within the owning section of the highlighted object. For instance, if Section2 were selected, then Section4 would be inserted between Section2 and Section3 rather than after Section3.

    Note: Sections are always reordered alphabetically by name when you save to make locating a section easier. However, run order depends on internal call section references and is, therefore, independent of the order in which sections are inserted and displayed.

  2. Enter the remaining section property values.

  3. Save the program.

Various methods are available for locating references to sections within an entire database as well as within a program.

Finding Call Section References

You can generate a list of all the references to a particular section. The list applies only to Application Engine programs defined within a single database.

To locate section references:

  1. Open the program containing the shared, or called, section.

  2. Select Edit, Find References.

    The Find Definition References dialog box appears.

  3. On the Call Sections tab, select the appropriate section from the Section name drop-down list or enter the name.

    By default, the current program name and MAIN section appear in the dialog box.

  4. Click OK.

  5. In the output window, view the generated list.

    The output window lists the programs and sections that call a particular program. This list also shows the total call references made to a particular section. Call sections within the current program appear first in the list.

    Double-click an item in the output window list to automatically navigate the definition view to that calling section.

Finding Sections Within the Current Program

Within large and complicated Application Engine programs, such as those upgraded from a previous release, having more than 100 sections is not uncommon. Rather than scrolling through a large program, use the Go To Section feature.

Note: This feature applies only to the current program.

To automatically navigate to a selected section:

  1. Select Edit, Go To Section.

    The Find Definition References dialog box appears.

  2. On the Go To Section tab, select the appropriate section from the Section name drop-down list or enter the name of the section.

  3. Click OK.

    The Definition view scrolls to the first occurrence of the section with the name you selected.

Controls that specify section properties are located in the Definition view. For example, for each section included in your program, a node, as shown in the following example, appears. You specify all of the attributes to associate with a particular section from this node:

Image: Section object

This example illustrates the fields and controls on the Section object. You can find definitions for the fields and controls later on this page.

Section object

The values you specify at the section level generally apply to all the objects contained within that section.

Field or Control

Definition

Section Name

Develop a naming convention and use it consistently throughout your projects. You are limited to eight characters.

Market

Select the market for which the section is intended. If a particular market is irrelevant to your batch program, keep the default market value of Global (GBL).

Platform

Select the target database platform for which this section definition will run. Leave the default value for all sections whose defined actions are not specific to a given database platform.

Effective Date

To make a particular section effective-dated, enter a target date.

Effective Status

Specify whether a section is active or enabled at runtime.

Section Type

If the program terminates abnormally, this value specifies whether you must restart the section.

If a section controls a procedure that, if not run to completion, could corrupt or desynchronize your data, then select Critical Updates. Otherwise, accept the default value of Prepare Only.

Auto Commit

Select to specify the commit level for the section. You can have no commit or you can have Application Engine commit after the step successfully completes.

Public

Select to enable a section to be called from another program.