HP 3000 Manuals

Examples Using Forced Control Characters [ HP RPG/XL Utilities-Part 1 XSORT ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 1 XSORT

Examples Using Forced Control Characters 

Forced control characters can be used to add to or replace a character in
a one-position control field.  Examples below show how to code four types
of forced control characters:

 *  Unconditional force.

 *  Force-all.

 *  Conditional force on normal or opposite control fields.

 *  Stand-alone conditional force.

Example 1: 
Unconditionally Forced Character 

In this example a control field ($) is unconditionally forced into the
work and output records.

[]
Example 2: Stand-Alone Conditional Force This example shows how different control field characters can be forced into position in the work record, depending on the character present in an input record position. Here the column 19 entry is used to specify conditional forcing of more than one character. Because continuation lines are used in this example, only one position in the work and output records is defined by the first three lines. If column 19 were left blank and no continuation lines were used, each line would then define a new position in the work and output records. When you sort records in ascending order, having placed an A in column 18 of the Header, XSORT places hex FF into the work record before you force any characters. When you sort records in descending order, having placed a D in column 18 of the Header, the program places hex 00 into the work record before any characters are forced.
[]
Example 3: Conditional Force on Normal or Opposite Control Field In this example, as in the one previous, the control field in the input record changes the work and output records. This example is significantly different, however. Here the control field is moved to the work record and then changes are made. This occurs because the first control fields are normal control fields.
[]
Example 4: Force-All In the example, if control fields contain characters other than 2, 4, and 6, use a force-all line so that you won't have a hex FF or 00 present in the work and output records.
[]


MPE/iX 5.0 Documentation