Important Note: The DBU is a database utility program that you can use to manipulate data directly. Great care should be taken when working in the DBU. You may cause irreparable damage, delete or change data if you do not know what you are doing. Make a backup before you open the DBU. Please follow the instructions very carefully. If you are unsure of any instruction please do not hesitate to contact Otomys directly at (012) 348 4071. Otomys will not be held accountable for any data loss or corruption.

How to fix a "DATA WIDTH" error when you run an update

A data width error occurs during a data conversion when a value in a field is larger than the width of the field. The field that keeps the amount for a creditor transaction is 10 characters wide with two decimal places.

This means that the maximum value it can hold is 9999999,99.  If the amount is 10 million or more, it needs 11 characters and will give a data width error.

 

Steps to correct this problem:

1.   Identify the table

2.   Restore a single template file from the update

3.   Run the data conversion on a single file

4.   Get the record number with the illegal value

5.   Repair the value

6.   Re-run the data conversion

7.   Open Microvet

 

Exit from of Microvet on all the computers

Do these steps on the File Server

Make a backup

 

1.  Identify the table

When you run the update, the name of the table with the problem will be displayed at the bottom left of the screen e.g. UPDATING STOCK.DBF.  In this case the file with the problem is STOCK.DBF

It could also bee in one of the following files:

UPDATING CASHCOLS.DBF.  In this case the file with the problem is CASHCOLS.DBF

UPDATING CASHITEM.DBF.  In this case the file with the problem is CASHITEM.DBF

 

2.  Restore a single template file from the update

In this case the name of the update file is APR2003.ZIP

The name of the template file is STO.DBF

Type the following on the DOS screen:

            PKUNZIP   -O   APR2003   STO.DBF  (Problem with STOCK.DBF)

(Use the zip file name of the update that you have run)

            or

            PKUNZIP   -O   APR2003   COL.DBF  (Problem with CASHCOLS.DBF)

            PKUNZIP   -O   APR2003   CHI.DBF  (Problem with CASHITEM.DBF)

 

3.  Run the data conversion on a single file

Type the following on the DOS screen:

            DBUPD   STOCK.DBF   STO.DBF

            or

            DBUPD   CASHCOLS.DBF   COL.DBF

            or

            DBUPD   CASHITEM.DBF   CHI.DBF

 

The update will run and get stuck at the same point with the message:  ‘DATA WIDTH ERROR.’

Press Enter to QUIT

 

4.  Get the record number with the illegal value

Start DBU as follows:

            DBU

            F2

OPEN

            Open STO.DBF   or (COL.DBF) or (CHI.DBF)

            OK

            F5

            DATABASE

Look at the top of the browse window for the record counter.  It may say RECORD  1/2345.

Get the number after the slash.  Zap the file as follows:

            ESC

            F6

            ZAP

            ZAP sto.dbf   or (col.dbf) or (chi.dbf)

            Yes

 

5.  Repair the value

DBU is still open. 

            F2

OPEN

            Open STOCK.DBF   or (CASHCOLS.DBF) or (CASHITEM.DBF)

            OK

            F5

            DATABASE

            F7

            GOTO

            Fill in the record number obtained in the previous step e.g. 2345

            OK

The record pointer is now on the record with the illegal value.  Press the right arrow to scroll to the right.

Look at the field values.  We are looking for a field that is filled with  ************  instead of numbers.

Remove these and replace it with 0.

Write the name of the stock file down so that you can correct the value when you open Microvet again.

            Press Enter

            ESC

            ESC

            Exit to DOS

            Y

 

6.  Re-run the data conversion

Type the following on the DOS Screen:

DPUPD   STOCK.DBF   STO.DBF

            or

            DBUPD   CASHCOLS.DBF   STO.DBF

            or

            DBUPD   CASHITEM.DBF   STO.DBF

  

Hopefully the conversion will complete its task.  If it gives the same ‘DATA WIDTH ERROR’, it means that there is another record with an illegal value.  Repeat steps 5 - 7

 

7.  Start Microvet

Start Microvet

The program will automatically start to re-index

A message may appear: ‘File is not marked with a code page’

Click on Windows

The selection will go to Windows ANSI

Click on Select

Log in

Edit the stock and type in the valid values of the affected fields