Space announcement This space provides the same content as before, but the organization of the home page has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Modifying segment contents by using expressions


Expressions can be used as a customization tool with the DEDB online restructure processes provided by the Fast Path Online Restructure/EP product.

During a DEDB online restructure, the OUTPUT subcommand and its associated keywords (SEGMENT, WHERE, and FIELDS) can be used to modify the content of the segment. By default, the output areas will contain the full, unmodified contents of the input segments. You specify the OUTPUT subcommand with the PREPARE command. The Prepare function creates a Restructure Plan data set that contains information about the changes you want to make to the database. The Restructure Plan data set provides input for the Restructure function.

The following considerations apply when you use the OUTPUT subcommand:

  • You must specify one or more OUTPUT subcommands for the segment you want to modify.
  • When the OUTPUT subcommand is specified, all input and output areas are selected for restructure processing. The OUTPUT subcommand forces an early termination to occur during restructure post-processing. The early termination allows you to perform any necessary application program changes before bringing the database back online. EARLY_TERMINATION=(BEFORE,START_DATABASE) is assumed.

For more information about the operations and syntax rules for coding expressions, seeFast Path/EP products reference documentation.

SEGMENT keyword

The SEGMENT keyword is required on the OUTPUT subcommand.

Use this keyword to select segments of the specified name for modification during the restructure process.

FIELDS keyword

To modify the segment contents, you can use the OUTPUT subcommand with the optional FIELDS keyword.

The FIELDS keyword specifies a list of expressions; the value of each expression is evaluated and placed into the output segment in the order that the expressions are specified. The length of the segment is computed by the product as the sum of the lengths of the values produced from these expressions.

The following figure shows an example in which the Prepare function specifies that a literal value be inserted into each occurrence of the output segment during a DEDB online restructure.

PREPARE DBD=dbdName...,
  OUTPUT SEGMENT=SEGD,
         FIELDS=(3:20,4P'0',23:*)

Note

If you modify the position or length of the symbolic key field, the FIELDS keyword is required on each of the OUTPUT subcommands for that segment.

Warning

When you use the FIELDS keyword with the OUTPUT subcommand to modify the value of the symbolic key field, the segments must remain in ascending key sequence under their parent. Fast Path Online Restructure/EP does not provide a facility to resequence the dependent segments. The restructure process terminates if the dependent segments are not maintained in ascending key sequence.

WHERE keyword

The content of the output segment can be controlled by using conditional qualification that is specified by the optional WHERE keyword on the OUTPUT subcommand.

If multiple OUTPUT subcommands are specified for the same segment, the first subcommand in which the selection criteria is satisfied is used. If the selection criteria is not satisfied for any OUTPUT subcommand for a segment, the input segment is copied to the output area without modification.

The following figure shows an example in which the Prepare function specifies that the content of a segment be conditionally modified during a DEDB online restructure. If the WHERE condition specified on the OUTPUT subcommand is met, the FIELDS keyword modifies the segment content. If the condition is not met, the segment content remains unchanged.

PREPARE DBD=dbdName,
  OUTPUT SEGMENT=SEGD,
          FIELDS=(3:20,C'ABC',26:*),
          WHERE=(23:3 EQ C' ')


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*