Created On:  16 November 2012

Problem:

With Visual COBOL for Visual Studio there is a sample solution called RMMFMigration.  This solution assists in the conversion of RM/COBOL data files to the Micro Focus Visual COBOL data file format.  

Converting RM/COBOL data files to Micro Focus Visual COBOL Format is a two step process.  The data file is first converted to an intermediate variable length sequential file by a conversion routine (ixconvert.cob) and is then passed to a Visual COBOL application (rebuild.exe) to convert the intermediate file into a Micro Focus Visual COBOL index file.

However this isn't an Eclipse version of this solution.

Resolution:

The RMMFMigration project is really just a front end that then calls ixconvert that does the real work. Ixconvert is an RM/COBOL object and can be run using ‘runcobol’. It will produce a Micro Focus binary sequential file and will return several pieces of information to the caller including the key expression string that would be used in the Micro Focus rebuild tool to create an indexed file using the /K parameter. 

Interface

Calling inxconvert:
       01  key-expr                    pic x(1000) value spaces.
       01  conversion-result           PIC X(200).
           88  conversion-successful   value spaces.
       01  RM-FILE-PATHNAME            PIC X(100).
       01  SEQ-OUT-FILE-PATHNAME       PIC X(64).
       01  maximum-record-size         PIC 9(8) BINARY VALUE 0.
       01  minimum-record-size         PIC 9(8) BINARY VALUE 0.
       01  converted-record-count      PIC 9(8) BINARY VALUE 0.
...
       CALL "inxconvert" USING
                   conversion-result
                   RM-FILE-PATHNAME
                   SEQ-OUT-FILE-PATHNAME
                   key-expr
                   maximum-record-size
                   minimum-record-size
                   converted-record-count
                   .
      CANCEL "inxconvert".
conversion-result is used to return the result of the conversion attempt to the calling program.  SPACES indicates a successful conversion, and any other value is in the form of an error message that may be used to diagnose the error condition.
RM-FILE-PATHNAME and SE-OUT-FILE-PATHNAME are input parameters, specifying the pathnames of the RM/COBOL indexed file to be converted and the resulting Micro Focus variable length sequential file, respectively.
The last four parameters may be used to invoke Visual COBOL rebuild and/or help confirm the conversion results.
key-expr returns a string which describes the key structure of the file formatted for use with the Visual COBOL rebuild /k option.
maximum-record-size and minimum-record-size return the maximum and minimum record size defined for the RM/COBOL indexed file.  If the indexed file has a fixed length records, the values returned in these two parameters will be equal.  Note that the Micro Focus output file format has a header which also contains these values and which will be used by rebuild to obtain the input record size range.  The values returned in these parameters may be useful if you decide to use the rebuild /r option to manipulate the record size of the rebuild output file.
converted-record-count is a count of records written to the Micro Focus variable length sequential file.
It is recommended that inxconvert be CANCELled if you intend to reuse it within a run unit.  This will force initialization of internal values upon each use.
Visual COBOL rebuild:
rebuild is part of the Micro Focus Visual COBOL distribution.  Please refer to your Visual COBOL documentation for information about using rebuild.

 

Incident #2601205