Working with automatic modification functions

The following 3 types of modifications are possible for the fields of a file:

  1. E - Extension of field length: You indicate the number of extension (or reduction) characters to be implemented for each impacted field.

    By default, the length modification of a file field will lead to the same modification being made to all the derived program fields.

  2. A - Addition of a file field (or even 2 fields): This is the addition of a new field called a 2nd field (just before, just after, or at the end of a record) for each impacted file field. This new field can have the same characteristics (Type/Length) as the reference field, or you can create a particular type and length for the field (Field $$F2).

    The name for the new fields will possibly be proposed before the actual addition which is carried out automatically; you should check this and if necessary, correct the new field names.

    You can include a dependent link at file key level (physical or logical).

    You can include the duplication of program code lines that use the propagated field, in order to obtain a similar line to the new file field (line duplication by imitation for an associated field).

    It is also possible to simultaneously add another file field, called a 3rd field. (Field $$F3).

  3. D - Deletion of a file field: The goal of this type of modification is to eradicate the fields which have become obsolete in the files and following that, remove the program code lines related to them.

For any type of modification chosen (A, E, D) you can include the insertion of routines in the programs (placed just after reading the file, or before writing the file).

Important!

There can be an absence or presence of reference file fields in the impacted file fields.

Normally, the reference file fields are never used in a program; they are there only to allow the descriptions of file fields by external reference to fields in reference files.

  • If you place the reference file fields in the list of fields to be processed:

    • The description of reference file fields will be modified (field extension or addition).
    • The PF fields referring to a reference file field will not be modified in the case of field extension (there will just be a flag put in).
    • In the case of field addition, these will refer to a new reference file field.
  • If you leave out the reference file fields from the list of fields to be processed:

    • The reference file will not be modified.
    • The PF fields referring to a reference file field will be relatively modified in the case of field extension.

      Example

      Before FIELDFI R REFFLD
      After FIELDFI R +3 REFFLD

  • The newly-added fields will be defined directly in the source of the PF.

Newly-added fields