Autosub halted after autoscan msg %CASH_I_0052 Cannot insert duplicate key row...

Document ID : KB000027577
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem:

Autosub can be halted, due to a problem occurring during autoscan.
In the following example of messages, the DYNAMIC job selection can be seen to cause errors % CASH _I_0052 and % CASH _W_0047 pointing to duplicate keys.

%CASH _I_0050, Autoscan started at 12.21.22 for 06/03/2006 at 00.00.00, type = Automatic
% CASH _I_0052, SQL message = Srv( ABC ) msg(2601) sta(3) sev(14)
Cannot insert duplicate key row in object ' STR ' with unique index
'STR _Idx'. proc( STR _Ins) dbproc(01243770)
%CASH _I_0052, SQL message = dberr(10007) sev(5) dbproc(01243770)
General SQL Server error: Check messages from the SQL Server.
%CASH _I_0052, SQL message = oserr(-1) sev(5) dbproc(01243770) (null)
%CASH _W_0047, Duplicate STR DYNAMIC, 0600
%CASH _I_0051, Autoscan is complete at 12.21.23
%CASH _W_0489, AUTOSUB inactive - job submission halted

It means that the DYNAMIC job still was in the tracking file while it was selected again during newday autoscan.

Another reason is that a backlogged job remained in the tracking file for >30 days as the qualifier being used is 'ddnn' where dd is the day number and nn is a number starting from 01 until 99.

Solution:

To correct this problem, check the jobset status gui (tracking file) and remove the Dynamic jobs in the file since they may be from a previous period.

To avoid this problem, set the Backlog to No in the Flags tab of the Jobset definition for Dynamic jobset. You must be aware that if you set this to No any Dynamic job that runs past the newday autoscan time will be terminated.

From the online help:

Main - Flags
Backlog

Indicates whether the jobset is eligible for backlogging, and can therefore be carried over to the next day's workload. If a jobset is not eligible for backlogging, at new day autoscan the unfinished jobset and all of its jobs are marked BKLCAN (Backlog Canceled) and are purged from the tracking file.

This field also indicates the default value for the BACKLOG operand for all jobs in the jobset. This value can be overridden in individual job profiles.

Note, however, that even if a Job profile specifies BACKLOG=Yes, when its jobset is marked BACKLOG=No, during new-day autoscan the unfinished jobset and all of its jobs are marked BKLCAN (Backlog Canceled) and are purged from the tracking file. Therefore, if you intend to backlog jobs, enter Yes in this field.

Valid specifications are:

YES Indicates that the jobset is eligible for backlogging and can therefore be carried over to the next day's workload. It also indicates that BACKLOG=Yes is the default value for all jobs in the jobset.

NO Indicates that the jobset is ineligible for backlogging and therefore will be purged from the tracking file at the next new-day autoscan. It also indicates that BACKLOG=No is the default value for all jobs in the jobset.

DEFAULT (Hewlett Packard NonStop Himalaya) Use whatever is specified in the Jobset profile.

Default: YES