Skip to main content

What to do when a KSDS file is defined in the FCT of Enterprise Server MTO and contains secondary keys, but OPEN in a batch processing program will fail for indexed files with a primary and alternate key.

Problem:

I am experiencing a problem where a KSDS file is defined in the FCT of Enterpriser Server MTO and contains secondary keys, but am getting a File Status 39 on OPEN in a batch processing program which fails for indexed files with a primary and alternate key.

Resolution:

In a batch oriented program you need to describe the alternate key, and that duplicates are allowed, if applicable. For example:

SELECT  UZ08  ASSIGN  '.\\DATA\\UZ08.DAT'
     ORGANIZATION  INDEXED
     ACCESS IS  DYNAMIC
     RECORD KEY IS  UZ08-PRIME
     ALTERNATE KEY IS  UZ08-KEY2  WITH DUPLICATES

Old KB# 14243

#Enterprise
#COBOL
#Server
#EnterpriseServer
#netexpress