ContentsIndexPreviousNext

A-DBM-ERROR-MAP-FILE

In order to allow you to cause specific COBOL errors to be returned due to various DBMaker errors, you may find that database error codes don't necessarily map well to COBOL error codes. To solve this problem, Acu4GL for DBMaker allows you to create an error map file to map native database errors to COBOL errors. Create the file using the guidelines described on the following page, and then use the configuration file variable, A-DBM-ERROR-MAP-FILE, to indicate the name and location of the file you created.

Example

If the file used for mapping is called MAP and this file is located in the directory C:\DBMaker, you would specify:

A-DBM-ERROR-MAP-FILE  c:\DBMaker\MAP

in the runtime configuration file. There is no default value for this variable.

Guidelines for creating map files

Although you can check your database documentation for error code information, the easiest way to determine what error codes need to be mapped to more appropriate COBOL codes is through trial and error. As users use Acu4GL for DBMaker, they may report receiving error messages that don't make sense based on their situation. Research these errors and try to determine a more appropriate COBOL error response.

When you create your error map file, use the following guidelines:

Begin comment lines with #. Blank lines are also considered comments.

Include two fields in each line in the section: the internal error number, and an ACUCOBOL-GT mapping string.

Using the same example, if you wanted to map the database error, "-346 Could not update a row in the table," to the COBOL error, "Not found," you would include this line in the section:

-346 E_NOT_FOUND

Other error maps would follow in the same section.

The valid values for the second field are as follows:

E_SYS_ERR
E_PARAM_ERR
E_TOO_MANY_FILES
E_MODE_CLASH
E_REC_LOCKED
E_BROKEN
E_DUPLICATE
E_NOT_FOUND
E_UNDEF_RECORD
E_DISK_FULL
E_FILE_LOCKED
E_REC_CHANGED
E_MISMATCH
E_NO_MEMORY
E_MISSING_FILE
E_PERMISSION
E_NO_SUPPORT
E_NO_LOCKS

Through experience, Acucorp has discovered specific ways to better map errors. For a list of these database error mapping suggestions, look at the file dbmaker.err on your installation disks.