HP 3000 Manuals

Callable Rebuild (DOS and OS/2 only) [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation


Micro Focus COBOL System Reference, Volume 1

Callable Rebuild (DOS and OS/2 only) 

Rebuildis a utility that you can use to maintain the indices of indexed
files.  See your COBOL System Reference for a full description.  It can
be executed with any of its usual options from within a COBOL program, as
follows:

call "CALLRB" using string-parameters,status-parameter 

where:

string-parameters   are the parameters you specify on the Rebuild command
                    line.  This parameter is a PIC X(600) item.  It must
                    be 600 bytes long since Rebuild scans the command
                    line backwards from offset 599 to find where the text
                    in the command line finishes.

status-parameter    is a PIC XX COMP X item and is the returned file
                    status showing the success of the call.

Because it is being called from within another program, Rebuild does not
know the status of the display screen, so it displays none of its usual
messages.  If an error occurs or the rebuild is not successful,
RETURN-CODE contains a non-zero value and status-parameter contains the
file status.  It is advisable that you always check RETURN-CODE after a
call to Rebuild.  The value of RETURN-CODE indicates the following:

Value        Description 

-------------------------------------------------------

0            Rebuild executed successfully.

1            An error occurred on the input file such
             as file not found or invalid file format -
             check status-parameter.

2            An error occurred on the output file -
             check status-parameter.

9            The parameter list contained an error such
             as an invalid option or an invalid
             combination of options.

If an error occurs, then it is strongly advised that Rebuild be executed
from the command line on the same file with a set of identical parameters
to see the output on screen to indicate the exact error.

Example 

       01 string-parameter     pic x(600).
      01 status-parameter    pic xx comp-x
     ...
     move "infile.dat, outfile.dat /s:lii /c:d1"
     to string-parameter
     call "CALLRB" using string-parameters,
     status-parameter
     end-call
     if return-code not = 0
     ...
     *       < code to check status-parameter &>
     ...
     end-if
     ...

Creating a Program that Calls Rebuild (DOS and OS/2 only) 

Callable Rebuild is supplied in a .lbr and .obj form.  If you are running
your COBOL program using the Run Time Environment, the .gnt form will
automatically be called from the library.  If you want to produce an .exe
executable file for your program, you must link the .obj file of Rebuild
with the .obj file of your program to create the .exe file.  A list of
the modules that have to be linked with your program is given below.
These are all provided in your COBOL system.

CALLRB.OBJ
RBLDMAIN.OBJ
RBLDSUB.OBJ
MSCVSUB.OBJ
FHREDIR.OBJ
EXTFH.OBJ
CBLDC001.OBJ
LOCFILE.OBJ
OBTRV.OBJ (if Btrieve is to be used on OS/2)
DBTRV.OBJ (if Btrieve is to be used on DOS)
WBTRV.OBJ (if Btrieve is to be used on Windows)
XFHNAME.OBJ (if file-name mapping is to be used)



MPE/iX 5.0 Documentation