RC 20,018 in Endevor API
search cancel

RC 20,018 in Endevor API

book

Article ID: 259120

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

A cobol program invoking API RESET PACKAGE function (copybook ECHAPRES) receives RC 20,018

JESMSGLG for the batch job that runs the program shows messages:

 17.08.50 JOB27632  +C1G0700I PROGRAM NDVRC1 WAS FOUND NOT TO BE AUTHORIZED
 17.08.50 JOB27632  +C1G0701I ALTERNATE ID, ACMQ, ESI, ELEMENT AND PACKAGE PROCESSING DISABLED
 17.08.50 JOB27632  +ENAPIMGR 20,018 C1G0703E ENDEVOR API OPERATING IN READ-ONLY MODE -EXEC TERMINATED
 17.08.50 JOB27632  +BC1PAPI - API HALTED BECAUSE RC=00020 ENCOUNTERED

The JCL invokes the program directly (EXEC PGM=pgmname instead of EXEC PGM=NDVRC1,PARM=pgmname)

Environment

Release : 19.0

Cause

The job step that runs the program is missing APF authorization as per message C1G0700I

API RESET PACKAGE action (as well as any action that needs to update Endevor datasets) needs to run in a jobstep with APF authorization. This is required, for example, to check security and to swap to the Endevor alternate ID when needed.

RC 20,018 from the Endevor API maps to

  • RC 20 - PROCESSING STOPPED
  • Reason code 18 - NDVRC1 NOT AUTHORIZED, API FUNCTION RESTRICTED

Resolution

Ensure that all the libraries allocated in STEPLIB DD are APF authorized, as required by batch Endevor utilities.

Additionally, if the program that calls the API is directly invoked by the JCL, the load module itself needs to be linkedited as APF via EITHER

  • Specifying AC=1 in the PARM field of the binder (program IEWL)
  • Specifying SETCODE AC(1) in the binder control statements

When a load module is APF, it shows '01' in the APF column in the member list display for the load library.