Running Convert5 in Interactive Mode [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation
Micro Focus COBOL Compatibility Guide
Running Convert5 in Interactive Mode
The Convert5 utility is entirely menu driven when run in the interactive
mode. It has an on-line help facility for each menu, which you can
access by pressing the key configured as the help key on your machine.
This displays a screen of information on the facilities available on each
menu.
To invoke Convert5 enter the command:
convert5
Once you have invoked Convert5 the main menu is displayed. From this
menu you can select any of the following functions:
* Help
* File Details
* Printfile Name
* Record Type Specification
* Generate Program
* Escape
To select the function of your choice, press the associated function or
character key, as indicated in the menu.
The following sections describe these functions.
Help
This function is available to you when the main menu is displayed, and
when you select either the File Details function, the Printfile Name
function or the Record Type Specification function.
When you select this function, a help screen is displayed for either the
main menu or the function you have selected.
File Details
Selecting this function on the main menu displays a screen which prompts
you to identify which data files produced by the DG Interactive COBOL
source program are to be converted.
You must enter all of the following information on the screen:
1. The FD name of the file to be converted, as it appears in the DG
Interactive COBOL source program.
2. The name of a DG Interactive COBOL source program which contains
the FD and SELECT...ASSIGN entries, as well as any record
definitions, for the file to be converted.
3. The name of the file conversion program which Convert5 is to
generate. This name cannot be the same as that of the DG
Interactive COBOL source program.
Press Enter to enter the data on this screen and return to the main menu.
If you specify an invalid parameter, the screen is redisplayed for you to
re-enter a valid one.
If you wish to return to the main menu without saving your entries, press
Esc.
Printfile-name
Selecting this function on the main menu displays a screen which prompts
you to enter the name of a file to which Convert5 will write all status
or error messages. If you choose not to enter this parameter, all
messages are output to the screen.
When an error message is written to the printfile-name you have entered,
the error message number is also displayed on your screen.
Record Type Specification
Selecting this function on the main menu displays a screen which allows
you to specify the information needed by Convert5 to process data files
that contain more than one record type. That is, you can provide the
information that Convert5 requires for data files that have more than one
01 level entry in their File Descriptions. You can uniquely determine
the type of each record in such multiple-record type files by entering
one of the following parameters:
* the name of a subprogram you have written which determines the
type of the records. Convert5 will call this subprogram when it
generates a file conversion program. See the section Identifying
Record Types By Subroutine later in this chapter.
* the name of an item in the data file record whose value determines
the type of the records. See the section Identifying Record Types
By Unique Record Item later in this chapter.
You cannot enter both of these parameters.
Press Enter to enter the data on this screen and return to the main menu.
If you specify an invalid parameter, the screen is redisplayed for you to
re-enter a valid one.
Press Esc to return to the main menu without saving your entries.
Identifying Record Types by Subroutine.
You can write a COBOL subroutine to determine each record type in a data
file with multiple types of records. The file conversion program calls
this subroutine each time it reads a record from the DG Interactive COBOL
data file. The conversion program passes the contents of the record to
the subroutine which must use some method to determine the type of
record. The subroutine then returns a value to the file conversion
program indicating the record type. This value is an index to the 01
level entries in the file's FD entry. For example, if a record
corresponds to the first 01 level entry in the FD, the subroutine should
return the value 1. If a record corresponds to the third 01 level entry
in the FD, the subroutine should return the value 3.
The format of the CALL statement in the file conversion program is:
call "name" using record-name, record-number, record-length
where:
name is the subroutine-name that you have supplied on
this screen
record-name is an alphanumeric data item referring to the
record that has just been read from the DG
Interactive COBOL data file
record-number is a PIC 99 field into which your subroutine will
return the number identifying the record type
record-length is a PIC 9(6) COMP item containing the length of
the record. This is supplied only if you are
converting a binary sequential file.
Below is an example of a subroutine that you could write to identify a
type of record.
linkage section.
01 record-name.
02 filler pic x(6).
02 rec-id-field pic 9(6).
01 record-type pic 99.
01 record-length pic 9(6) COMP.
procedure division using record-name,
record-type, record-length.
main-para.
if rec-id-field <10
move 1 to record-type
else
if rec-id-field <80
move 2 to record-type
else
move 3 to record-type
exit program
Identifying Record Types by Unique Record Item.
The file conversion program may be able to determine a type of record in
a file with multiple types of records by examining the value of a
particular data item. However, it can do this only if this value
uniquely determines the record type.
If this is true, enter the name of the record item on this screen as it
appears in the FD entry in the DG Interactive COBOL source program. Now
you must enter a list of level 88 conditions and the record numbers that
each of these conditions identify. The record number, as with the value
returned by a subroutine, indexes the appropriate 01 level entry in the
FD.
For example, you might make the following entries on this screen:
Identifying Data Item OR User Subprogram-name
[REC-TYPE-ITEM ]
record value(s)
number
[1] [1 thru 15 ]
[2] [16 ]
[3] [17 19 21 24 thru 30 ]
[4] [18 20 ]
[5] [22 23 ]
[6] [OTHERWISE ]
[ ] [ ]
[ ] [ ]
[ ] [ ]
[ ] [ ]
The sequence in which these entries appear is significant. See the
section Example Parameter List later in this chapter for details.
Binary Sequential Files.
In a binary sequential file with multiple record types, the file
conversion program can identify a record type by its length as long as no
two record types have the same length. However, if they do, you will
have to use either the subroutine or unique identifier method described
in the previous sections to identify the record type.
Generate Program
Selecting this function from the main menu generates the file conversion
program. You must have previously supplied Convert5 with all of the
necessary parameters to enable it to generate this program.
The message:
Creating Source
is displayed while Convert5 generates the file conversion program.
If any errors occur during generation, relevant error messages are
displayed on the screen. If you have specified the name of a printfile
these messages are also written to that file.
When a file conversion program has been successfully generated you are
returned to the main menu.
Escape
Leaves the Convert5 utility and returns you to your main system prompt.
You are asked to confirm that this is what you want to do.
MPE/iX 5.0 Documentation