MainframeKit

-551

SQLSTATE 42501NEGATIVE SQLCODE

The authorization ID has no privilege for that operation on that object. The message names all three, so the fix is a precise grant, not a broad one.

MOST LIKELY

A new table or view was created, and nobody granted access to the users or groups that read it.

FIRST CHECK

Grant the smallest privilege the job needs (often just SELECT) to the group your standards name.

TRY IT ▸

MainframeKit assistant

What it means

Db2 checked the privileges of the authorization ID (and the groups it belongs to) and found none that allows the operation on the object. The message tells you who (the ID), what (the operation) and on which object.

Typical causes

  • A new table or view was created, and nobody granted access to the users or groups that read it.
  • The grant was made to the wrong group, or to a person instead of the job's ID.
  • The job now runs under a different user ID.
  • A privilege was revoked.

How to fix it

  1. Grant the smallest privilege the job needs (often just SELECT) to the group your standards name.
  2. Make the grant as someone allowed to: the owner (for example after SET CURRENT SQLID to the owning group) or a user with authority.
  3. Avoid PUBLIC, ALL and WITH GRANT OPTION as quick fixes: they give far more than the job needs.

Example

Illustrative only; names and values are invented.

DSNT408I SQLCODE = -551, ERROR:  USER01 DOES NOT HAVE THE PRIVILEGE TO PERFORM
         OPERATION SELECT ON OBJECT USER02.BRANCH_FEE
DSNT418I SQLSTATE   = 42501 SQLSTATE RETURN CODE