HP 3000 Manuals

Supported Data File Types [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL Compatibility Guide

Supported Data File Types 

Convert5 can convert sequential, relative and indexed files from DG
Interactive COBOL format to Micro Focus COBOL format.  You do not need to
convert line sequential files as these are already in a format which is
compatible with this COBOL system's requirements.

Sequential Files 

Convert5 supports sequential files with either fixed or variable length
records.  The default record type has fixed length records.  However, it
will handle a sequential file with variable length records if the
RECORDING MODE IS VARIABLE clause is included in the FD entry.

Relative Files 

Before transferring relative files to this COBOL environment, you must
reformat them.  To do this, you must add a four-byte field containing
each record's relative key, to the start of every record contained in the
original data file.  The following code is an example of a program which
performs this reformatting for a specified relative file.  It must be run
on your DG machine.

      identification division.
      program-id. rel2seq.
      date-written. 10/22/85.
     *
     * this program converts a dg relative file to a
     * format suitable for subsequent conversion
     * for use with the Micro Focus system
     *
      environment division.
      configuration section.
      source-computer. dg-10.
      object-computer. dg-10.
     *
      input-output section.
      file-control.

        select relative-file
              assign to disk "dgrelative"
              organization is relative
              access is sequential
              relative key is relative-key
              file status is file-stat.

        select mf-file assign to disk "mfrelative"
              organization is sequential
              access is sequential
              file status is file-stat.

     data division.
      file section.
       fd relative-file
          label records are omitted.
       01 relative-rec            pic x(20).

     fd mf-file
          label records are omitted.
      01 mf-rec.
          03 mf-key               pic 9(9) comp.
          03 mf-data              pic x(20).

     working-storage section.
      01 relative-key             pic 9(4) comp value 0.
      01 file-stat                    pic xx value "00".
      01 relative-flag             pic 9 value 0.
      01 relative-cnt              pic 9(9) value 0.
      01 mf-cnt                      pic 9(9) value 0.

     procedure division.
      main-procedure section.
      main-proc1.
          open input relative-file
               output mf-file.
          perform read-write until relative-flag = 1.
          display "relative records read = " relative-cnt.
          display "mf records written = " mf-cnt.
          close mf-file relative-file.
          stop run.

     read-write section.
      read-write1.
          read relative-file
           at end         move 1 to relative-flag
              go to read-write-exit.
          if file-stat not = "00"
              display "input file status = " file-stat
              stop run.
          add 1 to relative-cnt.
          add 1 to mf-cnt.
          move relative-key to mf-key.
          move relative-rec to mf-data.
          write mf-rec.
          if file-stat not = "00"
              display "output file status = " file-stat
              stop run.

     read-write-exit.
          exit.

Once you have reformatted your data file, following the guidelines given
in the example, reform5 can read it sequentially and convert it to the
relative format used by this system.

Indexed Files 

You must pass any indexed data files which you wish to convert to

Micro Focus COBOL format, through the DG Interactive COBOL utility REORG.
This enables Convert5 to read the data portion of the files sequentially.
It can then convert them to the indexed format used by this system.



MPE/iX 5.0 Documentation