HP 3000 Manuals

Conditional Force [ HP RPG/XL Utilities-Part 1 XSORT ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 1 XSORT

Conditional Force 

A conditional force can be used only when a particular entry appears in
the record.  It allows you to change that entry to an alternate value for
sorting purposes only.  For example, you might have records to sort, each
with a one-position control field.  If that control field character were
an A and you wished to change it to a $ for sorting, you would use
conditional force.  XSORT would respond to your instructions in the
following way:

 *  Build a work record from the input record.

                    |------|---|------|                       |---|------|
         Input      | DATA | A | DATA |                Work   | A | DATA |
         Record     |------|---|------|                Record |---|------|

    A 1 - position control field (A) in input record is moved to first
    control field position in work record.

 *  Change each A to a $.

                  |---|-------|                |---|-------|
                  | A |  Data |                | $ |  Data |
                  |---|-------|                |---|-------|
                   Original work record         Changed work record

There are two types of conditional forces: 

 *  Conditional force on Normal or Opposite control field.

 *  Stand-alone conditional force.

Conditional force on Normal or Opposite Control Field 

This allows you to specify a 1-character normal or opposite control field
and have it converted to an alternate value on the work record, depending
on its value on the input record.  To use this option, you must first
specify the normal or opposite control field and immediately follow it by
the conditional force line or lines.  Each conditional force line must
show the same input field location in columns 13-16 and must include a
continuation character in column 19 to indicate it is a continuation of
the specification of the normal or opposite control field.  This force
option does not increase the length of your work record.  It only
overlays an already defined position.

Stand-Alone Conditional Force 

If your conditional force lines are not a continuation of the
specifications of a normal or opposite control field (see discussion
above), XSORT will place a hex FF (if the sort is ascending) or a hex 00
(if the sort is descending) in the next available work record position.
It will use that position as if it were a normal or opposite control
field.  Processing of the conditional force specifications then
continues, based on that new position.  Each conditional force line in a
stand-alone group must show the same input field location in columns
13-16, even though that input field is never moved into the work record.
(It is only used to determine what character, if any, is to overlay the
hex FF or 00 in the work record.)

All lines except the first must include a continuation character in
column 19.  A stand-alone force group increases the length of your work
record by 1.

Force-All 

Force-all is a different type of conditional force.  It works only when
the control field of the input record does not contain a particular entry
or entries.  For this reason it is sometimes referred to as a "catch-all"
operation.

A force-all line always follows a series of conditional force lines.  The
combined conditional and force-all abilities allow you to give XSORT
instructions such as the following:

 *  If the control field is an A, place a 5 in the work record.

 *  If the control field is a J, place a 4 in the work record.

 *  If the control field contains neither an A nor a J, place a $ in the
    work record.

Here you are using two stand-alone conditional forces and following them
with a force-all.

If the control field were in position 12 of the input records, here is
how you would enter Field Description specifications for the example just
described:

[]


MPE/iX 5.0 Documentation