Supplementary Information [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation
Micro Focus COBOL Compatibility Guide
Supplementary Information
* Provided you have not specified the /v option, you can redirect
all information displayed by Rebuild to a text file. To do this,
use standard redirection, >> for creating a new file and >>>> for
extending an existing file. Thus, you can collect the results of
a number of conversions in a batch stream as the stream is
processed, and view them on completion. For example:
rebuild olds001.dat,ms001.dat /s:ms1 /k:1+20 /i >> rebuild.prt
rebuild oldrt549.seq,rt549.seq /s:ms2 /o:s /r:v5-1000 /i
>>>> rebuild.prt rebuild badms001.dat,ms001.dat @ms001.par >>>> rebuild.prt
causes the information for all three conversions to be placed in the text
file, rebuild.prt, one after the other. You can view this later using a
text editor or the "type" command.
* Microsoft COBOL Version 2.2 allows the specification of keys in
the SELECT clause of a program to differ from the keys actually
contained in the file, provided the keys at variance are not
referenced. However, this version of the COBOL system will check,
when the file is opened, that the keys in the file match the
description in the SELECT clause, and return an appropriate error
status if not.
If this occurs, use the /i option when converting the file to
display the key structure in the file, compare this with the key
structure defined in the program, and either change the program to
match the file, or use Rebuild again on the converted file to
rebuild the index, specifying the full key description required
for the file using the /k option. (See your COBOL System
Reference for a description of this use of Rebuild.)
* When converting a Microsoft COBOL Version 2.2 file, if you do not
know the maximum record length, and the longest record is longer
than the first record in the file, running Rebuild without a /r
option will cause an error. However, you can specify the /i
option, to display the length of the longest record read so far.
Using this length in the /r option and rerunning Rebuild will
enable more records to be converted. The error may occur again,
in which case repeat the above procedure until the file is fully
converted.
For example, the first pass:
rebuild oldfile,new/s:ms2/i
gives:
++***Error on input file - record size >> specified - records read = 0001
Input file : OLDFILE
Largest record length - 293
Smallest record length - 253
Average record length - 546
Output file : NEW
Organization - Indexed
Recording mode - Fixed
Maximum record length - 253
Minimum record length - 253
Keys description :
Start char Length
Key - 0
1+ 9
The second record was bigger than the first, so Rebuild failed after
reading it. Rerun Rebuild adding a /r option using this largest record
length, as follows:
rebuild oldfile,new/s:ms2/r:f293/i
This gives:
++***Error on input file - record size >> specified - records read = 0005
Input file : OLDFILE
Largest record length - 353
Smallest record length - 253
Average record length - 339
Output file : NEW
Organization - Indexed
Recording mode - Fixed
Maximum record length - 293
Minimum record length - 293
Keys description :
Start char Length
Key - 0
1+ 9
The sixth record is bigger than the maximum given, so you need to repeat
the procedure with the new largest record length, as follows:
rebuild oldfile,new/s:ms2/r:f353/i
This gives a successful conversion:
Conversion successful - records read = 0049
Input file : OLDFILE
Largest record length - 353
Smallest record length - 119
Average record length - 261
Output file : NEW
Organization - Indexed
Recording mode - Fixed
Maximum record length - 353
Minimum record length - 353
Keys description :
Start char Length
Key - 0
1+ 9
MPE/iX 5.0 Documentation