HP 3000 Manuals

Invoking Rebuild [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL Compatibility Guide

Invoking Rebuild 

To invoke Rebuild, you enter:

rebuild in-file, out-file /s..[options] 

where:

in-file               is the name of the file to be converted

out-file              is the name of the file to contain the result.
                      This must be different from in-file. 

/s                    defines the format of the input file and must be
                      specified

options               can be any of the following:

                      /o                    defines the organization of
                                            the input file and output
                                            files

                      /r                    defines the record lengths
                                            and recording mode of the
                                            input file and output files

                      /k                    defines the key structure of
                                            the output file

                      /i                    causes Rebuild to display
                                            information

                      /v                    causes Rebuild to display a
                                            running record count.

You may place the options anywhere in the command.  They are free-format
with spaces allowed between fields.  See your COBOL System Reference for
details of the options.

You can add parameters to some of the options; these determine how the
option is interpreted at run time.  You can specify parameters in two
ways on the command line:

   *   with the option, separating each parameter with an optional colon
       ( :  )

   *   by naming parameter files.  See the section Parameter Files later
       in this chapter for details on how to do this.

The following sections describe these options and which parameters you
can specify with them.

The /s Option 

The /s option is used for the conversion process to define the format of
the input file.  You must specify this option.  The allowed parameters
are ms1 and ms2, where:

/s:ms1 indicates the input file is a Microsoft COBOL Version 1 file

/s:ms2 indicates the input file is a Microsoft COBOL Version 2.2 file

The output file will always be in the format used by this system.

The /o Option 

The /o option defines the organization of the file to be converted.  If
the option is omitted, indexed is assumed.  The organization is
identified by a single letter parameter, where:

/o:s indicates the input file is sequential

/o:r indicates the input file is relative

/o:i indicates the input file is indexed (the default)

The output file is always the same organization as the input file, but is
in a format suitable for use with this COBOL system.

The /r Option 

The /r option defines the record lengths and recording mode of the input
and output files.  When you specify this option you should also specify a
parameter which defines the record structure of the output file, where:

/r:frecord-length indicates a fixed length format, followed by the length
of the fixed records (the default)

/r:vminimum record length-maximum record length indicates a variable
length format, followed by the minimum and maximum lengths of the
variable length records, separated by a hyphen (-).

In the case of variable length formats, if you specify the minimum and
maximum lengths as the same value, a variable format file will be created
with fixed length records.

To access files created using the v parameter, you should include the
RECORDING MODE Vclause in the File Description (FD) of the accessing
program.  RECORDING MODE F is the default.  Alternatively, if you convert
every file with a v parameter, you do not need to alter your source
programs.  Instead you must submit your programs to this COBOL system
with the RECMODE"V" system directive set, which will make the default
recording mode variable for every FD.

If the recording mode of a file does not match the one you specified (or
the default) in the FD, an error status will be given when the file is
opened.

You may omit the lengths for converting Microsoft COBOL files with fixed
length records and Microsoft COBOL Version 1 relative files, but not
Microsoft COBOL Version 2.2 relative files.  When you omit the record
length, it will be taken as the length of the first record in the file.

For relative files, the lengths you give must be exact.  If not, the
records are not correctly transferred, but no warning is given.  For
sequential and indexed files, if you give a fixed length which is smaller
than the maximum record size of the input file, an error will occur.  If
the fixed length you give is larger than the maximum record size, or the
input file has variable records, and the fixed length is the same as the
maximum, all the records will be written at the length specified, padded
with ASCII spaces.

Consider the following example settings of this /r option:

/r:f                  indicates that the output file is a fixed format
                      file, with all records the same length as the first
                      record in the input file

/r:f235               indicates that the output file is a fixed format
                      file, with records of 235 characters in length

/r:v                  indicates that the output file is a variable format
                      file, with all records the same length as the first
                      record in the input file

/r:v76-76             indicates that the output file is a variable format
                      file, with all records of 76 characters in length

/r:v23-678            indicates that the output file is a variable format
                      file, with all records between 23 and 678
                      characters in length

The /k Option 

The /k option defines the key structure for an indexed file.  You use
this option to convert Microsoft COBOL Version 1 files whose key
information file (.KEY)is missing.  Microsoft COBOL Version 2.2 indexed
files contain the key information in the data part of the file.  Thus,
this option is not needed even if .KEY is missing.

The parameters for this option define the keys.  The definitions of two
or more keys are separated by a colon ( :  ).  You can define each key as
a number of parts (split key), each part being separated by a comma ( ,
).  You define the key part by a start character position and length,
separated by a plus (+) or L.

For alternate keys (those other than the first defined), an additional
parameter, the character d, should terminate the definition if they are
defined as "WITH DUPLICATES".

For example:

/k:1+20                   defines a single key, starting at character
                          position 1, length 20 characters

/k:5+5:20+1d:40+2,43+10   defines three keys, the third being split, and
                          the second allowing duplicates.  The first key,
                          the record key, starts at character position 5,
                          length 5; the second key, an alternate key
                          allowing duplicates, starts at 20, length 1;
                          and the third key, a split alternate key, has
                          two parts, the first starting at 40, length 2,
                          the second at 43, length 10.  The first
                          character position in a record is position 1.

The /i Option 

If you specify the /i option, Rebuild displays information about the
input and output files, including record lengths, file type and, for
indexed files, key structure.

It is not possible to obtain information about a file without actually
invoking a conversion.

Examples.   

The command line:

     rebuild oldfile,new/s:ms2/i

causes the following information for the conversion of the fixed length
file oldfile to be displayed:

      Conversion successful - records read = 0055

      Input file : OLDFILE
          Record length - 41
      Output file : NEW

              Organization - Indexed
              Recording mode - Fixed
              Record length - 41
              Keys description :
                  Start char Length
              Key -0
                   1+          6

and the command line:

     rebuild oldfile,new/s:ms2/r:v40-100/i

causes the following information for the conversion of the variable
length file oldfile to be displayed:

      Conversion successful - records read = 0055

     Input file : OLDFILE
          Largest record length  -        100
          Smallest record length -         45
          Average record length  -        75

     Output file : NEW
          Organization - Indexed
          Recording mode - Variable
          Maximum record length -    40
          Minimum record length -   100
          Keys description :
              Start char   Length
          Key - 0
                         1+         6
          Key -     1          with duplicates
                      10+          5
                      20+          3

The /v Option 

If you specify the /v option, Rebuild displays a record count on the
screen which it increments as it processes the file.  This is useful if
you wish to see how Rebuild is progressing.  You must not use the /v
option if you are redirecting the output.  This option is intended for
interactive use only.

Examples 

     rebuild oldms001.dat, ms001.dat /s:ms1 /o:i/r:f120 /k:1+20

     rebuild oldms001.dat, ms001.dat /s:ms1 /k:1+20

These commands convert a Microsoft COBOL Version 1 indexed file, with
fixed length records of 120 characters, and a single key of 20 characters
starting at position 1, where the .KEY file is missing.  If the .KEY file
is present, the /k option is not needed.

     rebuild oldms001.dat, ms001.dat /s:ms2 /o:i/r:f120

     rebuild oldms001.dat, ms001.dat /s:ms2

These commands convert a Microsoft COBOL Version 2.2 indexed file, with
fixed length records of 120 characters.  The key information is extracted
from the start of the data file.  Thus, this conversion can take place
even if the .KEY index file is missing or corrupt.

     rebuild oldrt549.seq,rt549.seq /s:ms2 /o:s/r:v5-1000 /I

This command converts a Microsoft COBOL Version 2.2 sequential file, with
variable length records of between 5 and 1000 characters.



MPE/iX 5.0 Documentation