Running Convert3 in Batch Mode [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation
Micro Focus COBOL Compatibility Guide
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):
COMP6-COMP FD IDENTIFIER LISTFILE PROGRAM RUN SIGN SOURCEFILE SUBROUTINE
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 mandatory 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
The FD Parameter.
The mandatory 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
The Program Parameter.
The mandatory 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.
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). 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 OTHERWISEcondition
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 the section Example Parameter File later in this chapter 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 tries the program generation process. This cycle
continues until all parameters in the parameter file have been read.
You must supply a run parameter.
The COMP6-COMP Parameter.
The comp6-comp parameter allows you to specify whether or not to convert
COMP-6 items to VS-COMP. The parameter has the following format:
comp6-comp [y/n]
where:
y gives behavior as described in the section COMP-6/
COMPUTATIONAL -6 Data in the chapter Converting
RM/COBOL Data Files
n means COMP-6 items are not converted to VS-COMP.
The default is y.
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 identifierparameter 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:
1. An item with one of the values 99, 103, 200, or 201 is in
record type 2.
2. An item with any other value in the range 1 to 2000 is in
record type 1.
3. An item with value 6786 or 9999 is in record type 3.
4. An item with any other value in the range 0 to 9999 is in
record type 2.
5. An item with any other value is in record type 4.
You can specify the same record number more than once in the same
set of record number parameters.
* The listfile parameterapplies 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