Skip to Content

Merge Stock Codes Utility

Datafile Software

Merge Stock Codes Utility

Where you have multiple operators maintaining the stock system and adding new records you may end up with the same stock item having been added into Datafile under two different stock codes.This utility, new in Release 6.1, allows the system to merge the data from one stock item into another before either deleting the ‘from’ item or marking it for year-end deletion.

Selecting the Merge option asks for the Stock Codes to merge from / to.

On selecting the FROM / INTO Stock items the system will display the stock maintenance screen for you to confirm you are selecting the correct items.

After selection the system will perform a ‘comparison’ check between the two stock records to ensure they are compatible. Items compared are:

Batch/Serial - Flag values must be identical (i.e. both blank, both B-Batch, S-Serial etc.)

Batch-Format - Formats for batch codes must match

Batch-Prefix - Flag for batch format to be pre-fixed with stock code must match

Non-Stock Flag - Flag value must be identical

Discount Group - If in use must match

If values do not match then the merge is rejected, if match then you are asked whether you wish to proceed with the merge.

The merge process will replace the ‘from’ stock code recorded on the following databases:

Stock Transactions – including the batch code if set to record on stock transactions

Batch Records – including the batch code if set to prefix. System will reject merge if would end up creating two batch/serial records with same prime-index

Batch Transactions – including the batch code if set to prefix

Stock Assemblies – optionally including the assembly code where assembly code matches the ‘from’ item being changed and updating wouldn’t result in two assemblies with the same code.

Stock Components – again including the assembly code if appropriate

Sales Order Details – all records, including completed order lines, are processed. If pre-allocating batch/serial numbers then the batch code is updated where appropriate.

Purchase Order Details – as above

Works Order Header – again including assembly code and pre-allocated batches were appropriate.

Works Order Detail – as above but also including any ‘sub-assembly’ settings.

Job Costing Transaction file – updating the stock file.

The merge process will update the pointer chains between the stock/stock transactions and stock/batch files were appropriate.

On the stock record itself if the system will accumulate the quantity, demand, sales and cost value settings from the from-item to the to-item before zeroing the from item. If set to use the year-end delete processes then the from-item is marked for year-end delete, if year-end not configured the from-item is deleted.

With regards to the Discount Matrix and Supplier Matrix the assumption is made that entries for the to-item will be kept as is and any from-item entries will be deleted.


The process requires exclusive locks to all databases updated; the system will not proceed with the merge unless all locks can be placed.

The process is a global change to all application files – it is strongly recommended that you take a full backup before proceeding with a merge.

If you have your own databases containing the stock code – a ProFiler database for example – then these databases will not be updated automatically and must be changed separately via other routines (i.e. a ProFiler global update etc.)


The new reporting options will need to be added to the stock menu – suggest the ST.D03 or the STTAK.D03.Sign on as the CONFIG user and amend the required application menu to add the new reports with the following parameters

Merge Stock Codes P-Program ST.EXE Parameter 1901

  • Release ID: 6.1