Adding Steps

A step represents the smallest unit of work that can be committed in a program. When you create a program, you have a default MAIN section and step that is initially named Step01.

This section discusses how to:

  • Insert steps.

  • Set up step properties.

To insert a step:

  1. Highlight the section or step that you want to precede the new step.

    For example, if you want the new step to be the first step in the section, select the section node. Otherwise, select the existing step that you want the new step to follow.

    Note: The name of the section in which you insert the step appears to the right of the step description. In large programs, this step enables you to determine the section in which a step resides if the section is not in view. Also, note that a sequence number appears on each step (001, 002, 003, and so on) so that you can determine the order of a step within a section. The sequence numbering for steps begins at 001 within each section.

  2. Select Insert, Step/Action.

    By default, the steps are given a default name of StepN+1 beginning with Step01. Rename the step to better define the type of action this step contains.

    Note: The designer continues to increment the step name until it has a unique step name within a section. If the designer is unable to create a unique name after 80 attempts, a new step is not inserted.

  3. Specify a step name and the remaining values.

    To rename a step, position the cursor in the step name edit box and enter a custom name. Only accept the default name for building quick, simple programs and for training purposes.

You set up step properties in Definition view.

Field or Control

Definition

Step Name

Enter a name (up to eight characters).

Commit

Specify the commit level for the step:

  • Default: Select to inherit whatever commit level you specified for the section in which the step resides.

  • Later: Select to postpone the commit until a subsequent commit occurs. Here you can override the section-level commit if it is set toAfter Step.

  • After Step: Select if you have a commit level ofNone specified at the section level. This selection enables you to override the section-level commit and commit a specific step within a section with no other commits.

Frequency

Enabled only when a step contains one of the following actions: Do While, Do Select, or Do Until. Enter the numeric frequency with which Application Engine should commit. If non-zero, Application Engine commits every N iterations and then again after the last iteration.

On Error

Specify how Application Engine should respond to an error at the step level. The On Error routine behaves the same for both SQL and PeopleCode actions. The program only terminates on errors, not warnings. Select from:

  • Abort: The application terminates with an error message.

  • Ignore: The program continues but logs an error message.

  • Suppress:The program continues and presents no error message.

  • SQL: Usually a program terminates if a SQL Prepare statement or execute fails. If you selectIgnore orSuppress, errors on running programs are suppressed, but errors on compiles still cause the program to terminate. Thus, if you select to reuse an Update statement, the program fails on the compile if the SQL is incorrect, but it does not fail on a duplicate key error or similar error when the program runs.

  • PeopleCode: The program has a PeopleCode error if the return code satisfies the statementIf (nRet & PCM_ERROR).

Status

Select to activate a step. If the step is currently applicable to your program (and working), you will probably want to keep it active.

Note: The On Error property does not apply to compile errors (for example, specifying erroneous SQL statements). It checks only for execution-type errors. If your program has a syntax error, the program terminates.