HP 3000 Manuals

Running convert3 in Interactive 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 Interactive Mode 

The convert3 utility is entirely menu-driven when run in the interactive
mode.  It has an on-line help facility on 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 convert3 enter the command:

convert3

Once you have invoked convert3 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 RM/COBOL source program
are to be converted.

Enter the following information on the screen:

   1.  The FD name of the file to be converted, as it appears in the
       RM/COBOL source program.

   2.  The name of the RM/COBOL source program which created the original
       data file.

   3.  The name of the file conversion program which convert3 is to
       generate.  This name cannot be the same as that of the RM/COBOL
       source program.

   4.  The setting of the RM directive.  This can be either R for
       RM/COBOL, or A for RM/COBOL with the ANSI switch set.

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 Escape to return to the main menu without saving your entries.

Printfile Name 

Selecting this function on the main menu displays a screen which prompts
you to enter the name of a file to which convert3 will write all status
or error messages.  If you choose not to enter this parameter, all
messages are output to the screen.

Record Type Specification 

Selecting this function on the main menu displays a screen which allows
you to specify the information needed by convert3 to process data files
that contain more than one record type.  That is, you can provide the
information convert3 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.  convert3 will call this subprogram when it
       generates a file conversion program.  See Identifying Record Types 
       By Subroutine later in this chapter.

   *   the name of an item within the data file record whose value
       determines the type of the records.

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 Escape to return to the main menu without saving your entries.

Identifying Record Types by Subroutine.   

You can use a 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 RM/COBOL data file.  The
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 RM/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.

Example 

Below is an example of a subroutine that you could write to identify a
type of record.

     linkage section.
     01 record-name.
         03 filler           pic x(6).
         03 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 > 9 and < 80
                 move 2 to record-type
             else
                 move 3 to record-type
              end-if
         end-if
         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 only do this 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 RM/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 "Example
Parameter File"  later in this chapter.

If the identifying data item is nonnumeric, you must ensure that each
value you enter is within quotation marks.  For example, if REC-TYPE-ITEM
in the above screen display is declared as PIC XX, you must make the
following entries on the screen:

     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                          ]
     [ ]         [                                   ]
     [ ]         [                                   ]
     [ ]         [                                   ]
     [ ]         [                                   ]

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 to identify
the record type.

Generate Program 

Selecting this function from the main menu generates the file conversion
program.  You must have previously supplied convert3 with all of the
necessary parameters to enable it to generate this program.

The message:

     Creating Source

is displayed while convert3 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 convert3 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