HP 3000 Manuals

Running Convert5 in Batch Mode [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL Compatibility Guide

Running Convert5 in Batch Mode 

If you wish to run Convert5 in batch mode, you must first write a
parameter file containing the parameters required by Convert5.  When you
then run Convert5, it first validates all of the parameters you have
entered, and if these are all valid, each invocation of Convert5 extracts
a full set of parameters from this file.  If the parameters are not
valid, no conversion takes place.

The Parameter File 

This is a free format line sequential file which contains a parameter on
each line.  If you enter any lines of space characters, these are ignored
by Convert5.

The first word on each line of the parameter file identifies the type of
parameter you are specifying.  This can be any of the following (in
upper- or lower-case characters):

       listfile

       sourcefile

       fd

       program

       subroutine

       identifier

       run

If you enter an asterisk (*) as the first non-space character on any
line, this line is treated as a comment line.

In addition a line may start with a record number (see the section Record 
Number Parameters later in this chapter) followed by a valid 88-level
condition.

The Listfile Parameter.   

This parameter specifies the name of a file where any error messages or
status values reported from Convert5 are recorded.  When you specify this
parameter, it remains valid until you specify the parameter again, so
ensuring that all the information reported during a run can be placed in
the same listing file.  If you specify the parameter again with another
file-name, subsequent messages are sent to this second file, while if you
specify the parameter with following spaces, these messages are sent to
your screen.

The parameter has the following format:

listfile file-name 

If you specify neither a listfile parameter nor a file-name after
listfile, messages are written to the screen.

The Sourcefile Parameter.   

This mandatory parameter gives the name of the DG Interactive COBOL
source program which Convert5 is to scan for information on the files to
be converted.  The parameter has the following format:

sourcefile file-name 

The FD Parameter.   

This mandatory parameter gives the internal name of the file as it is
appears in the FD entry of the DG Interactive COBOL source program you
specified in the sourcefile parameter.  The parameter has the following
format:

fd file-name 

The Program Parameter.   

This mandatory parameter gives the name of the source program which
Convert5 creates.  The parameter has the following format:

program file-name 

The program-name must not be the same as the name used in the sourcefile
or listfile parameter.

The Subroutine Parameter.   

This parameter gives the name of a COBOL subroutine that you supply as it
will appear in a CALL statement in the file conversion program.  For
files which contain multiple records this subroutine will identify the
correct record definition, allowing you to convert files of any logical
complexity.  The parameter has the following format:

subroutine program-name 

The Identifier Parameter.   

The identifier parameter specifies the name of an item in the file record
whose value can be used to uniquely determine a type of record in a file
with more than one record type.  The parameter has the following format:

identifier file-name 

Record Number Parameters.   

If you have specified an identifier parameter, you must specify a number
of parameters that indicate which values of the item named in the
identifier parameter correspond to which record types.  Each parameter
has the following format:

record-number condition 

where:

record-number         indicates a record type (1 means the first 01level
                      entry in the FD, 2 means the second 01 level entry,
                      and so on).  Record identification is carried out
                      in the order in which the record-numbers are
                      specified.

condition             is an 88-level record-type which, if true,
                      indicates that the associated record-number gives
                      the correct record type.  The OTHERWISE condition
                      indicates the correct record type for those values
                      of the item named in the identifier parameter which
                      you have not previously specified in the Record
                      Number parameter.  All record number parameters
                      must immediately follow the identifier parameter,
                      and must be in the order you want record
                      identification to be carried out.

See the section Example Parameter List later in this chapter for an
example of the use of these parameters.

The Run Parameter.   

The mandatory run parameter invokes Convert5 with those parameters that
have already been read.  The parameter has the following format:

run 

Example Parameter List.   

The parameter list shown below is an example of a parameter file that you
could supply to Convert5.  This file generates file conversion programs
for three DG Interactive COBOL data files.

     **********************************
     *  Parameters for first run       *
      **********************************
     listfile history.lst
     sourcefile payroll1.cbl
     fd employee-file
     program progemp
     identifier employee-status
     2 99 103 200 201
     1 1 thru 2000
     3 6786 9999
     2 0 thru 9999
     4 otherwise
     run
     **********************************
     *  parameters for second run  *
     **********************************
     sourcefile payroll2.cbl
     * listing will go to history.lst
     fd branch-file
     program progbran.cbl
     subroutine branchek
     run
     **********************************
     *  last run  *
     **********************************
     listfile logfile
     sourcefile payroll2.cbl
     fd history-file
     program history.abc
     run

In the above example, the parameters for the first run are designed to
provide for a file comprising four record types.  These records are
identified by a data item in one of the records.  If this item has the
value 6786 or 9999, it is record type 3.  If the values lie within the
range 1 to 2000 excluding 99, 103, 200 and 201, it is record type 1.  Any
other values within the range 0 to 9999 are record type 2, while any
values lying outside this range are record type 4.

The second file which is to be converted during the run of this parameter
file also contains multiple records.  However, record identification in
this case is carried out via the user-supplied subroutine named
"branchek".

The third file converted on the final run comprises only one record type,
and so record identification is not necessary.

The above example illustrates that record identification via level 88
data items is carried out in the order in which the parameters are
presented.


NOTE You can identify the same record type more than once. You may find this useful if more than one parameter is required to cover all possible combinations of data value.
Running Convert5 with a Parameter File To invoke Convert5 in batch mode enter the command: convert5 parameter-filename where parameter-filename is the name of your parameter file. Convert5 now runs in batch mode, extracting a full set of parameters from the parameter file with each invocation. The parameters supplied in the file are always validated completely. If any errors are detected during this validation, no conversion takes place. You can validate the entries in a parameter file by entering: convert5 parameter-filename validate If you enter this command, the contents of the parameter file are validated, but no conversion takes place, even if all of the parameters are valid.


MPE/iX 5.0 Documentation