HP 3000 Manuals

Running convert3 in Batch Mode [ COBOL/HP-UX Compatibility Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Compatibility Guide for the Series 700 and 800

Running convert3 in Batch Mode 

You can run convert3 in batch mode by placing all necessary control
parameters in a parameter file and running convert3 so that it reads
parameters from this file rather than from the screen.

You can include parameters for several runs of convert3 in the same
parameter file.  This means that you can write a single parameter file to
convert all of your data files at once.

The Parameter File 

The parameter file is a free format line sequential file.  You can
specify one parameter per line.  You can leave blank lines in the
parameter file to improve readability since they are ignored by convert3.
You can also insert comment lines in the parameter file by using an
asterisk (*) as the first non-space character in the line.

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 lowercase characters):

     LISTFILE
     SOURCEFILE
     FD
     PROGRAM
     SUBROUTINE
     SIGN
     IDENTIFIER
     RUN

In addition, a line may start with a record number followed by a valid
88-level condition.

The Listfile Parameter.   

The LISTFILE parameter specifies the name of the file to which convert3
will write any status and/or error messages.  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.   

The SOURCEFILE parameter specifies the name of the RM/COBOL source file
containing the description of the data file to be converted.  The
parameter has the following format:

     SOURCEFILE file-name

You must supply a SOURCEFILE parameter.

The FD Parameter.   

The FD parameter specifies the name in the FD entry of the data file to
be converted as it appears in the RM/COBOL source program.  The parameter
has the following format:

     FD file-name

You must supply an FD parameter.

The Program Parameter.   

The PROGRAM parameter specifies the name of the file conversion program
that convert3 will generate.  The parameter has the following format:

     PROGRAM program-name

The program name must not be the same name used in the SOURCEFILE or
LISTFILE parameter.

You must supply a PROGRAM parameter.

The Subroutine Parameter.   

The SUBROUTINE parameter specifies the name of a subroutine that the file
conversion program can call to determine a type of record in a file with
more than one record type.  The parameter has the following format:

     SUBROUTINE program-name

The Sign Parameter.   

The SIGN parameter specifies how the sign is represented in items with
USAGE DISPLAY. The parameter has the following format:

SIGN {INCLUDED}
     {SEPARATE}

If you don't supply a SIGN parameter, SEPARATE is assumed as the default.

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 item-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 01 level
                     entry in the FD, 2 means the second 01 level entry,
                     and so on).  Note that 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 that you have not previously
                     specified in the Record Number parameter.

You can specify these parameters in any order of record-number, but all
record number parameters must immediately follow the IDENTIFIER
parameter.

See "Example Parameter File"  for an example of the use of these
parameters.

The Run Parameter.   

The RUN parameter invokes convert3 with those parameters that already
have been read.  The parameter has the following format:

     RUN

It does not matter whether convert3 has successfully generated a file
conversion program for one set of parameters.  convert3 continues to read
the next set until the next RUN parameter is encountered, at which point
convert3 again attempts the program generation process.  This cycle
continues until all parameters in the parameter file have been read.

You must supply a RUN parameter.

Example Parameter File.   

The following is an example of a parameter file that generates file
conversion programs for three RM/COBOL data files.

     **************************************************
     * Parameters for first run                      *
     **************************************************

     LISTFILE history.lst
     SOURCEFILE payroll1.cbl
     FD employee-file
     PROGRAM progemp.cbl
     SIGN separate
     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
     SIGN included
     PROGRAM program.cbl
     SUBROUTINE branchek
     RUN

     **************************************************
     * Parameters for third run                      *
     **************************************************

     LISTFILE logfile
     SOURCEFILE payroll2.cbl
     FD history-file
     PROGRAM history.abc
     SIGN included
     RUN

Notes 

   *   In the parameters for the first run, the record number parameters 
       following the IDENTIFIER parameter must be in record number order.

   *   You can use the word "otherwise" as the 88-level condition in a
       record number parameter.  If none of the previous record number
       parameters has successfully determined the record type, the record
       type associated with the "otherwise" condition is assumed.

   *   Record identification using record numbers is carried out in the
       order in which the parameters are presented in the parameter file.
       Thus, in the first run:

          a.  An item with one of the values 99, 103, 200, or 201 is in
              record type 2.

          b.  An item with any other value in the range 1 to 2000 is in
              record type 1.

          c.  An item with value 6786 or 9999 is in record type 3.

          d.  An item with any other value in the range 0 to 9999 is in
              record type 2.

          e.  An item with any other value is in record type 4.

       Notice that you can specify the same record number more than once
       in the same set of record number parameters.

   *   The LISTFILE parameter applies to all the runs in the parameter
       file.  The same list file will be used until another LISTFILE
       parameter is read.  Thus, the file history.lst is used for the
       first two runs, and the file logfile is used for the third run.

Running convert3 with a Parameter File.   

To run convert3 with a parameter file, enter the command:

     convert3 parameter-filename

Each set of parameters is validated by convert3 before the file
conversion program is generated.  If any parameters are invalid, that
particular file conversion program is not generated, and convert3 passes
to the next set of parameters in the parameter file.

You can validate the parameters in a parameter file by entering:

     convert3 parameter-filename VALIDATE

The contents of the parameter file are validated, but no file conversion
programs are generated.



MPE/iX 5.0 Documentation