0308 or xx08 error-status in called cobol program
search cancel

0308 or xx08 error-status in called cobol program

book

Article ID: 249272

calendar_today

Updated On:

Products

IDMS

Issue/Introduction

A cobol program being called by another in an extended run-unit situation is encountering an 0308 or other xx08 error-status.

Environment

Release : All supported releases
Component : IDMS/DB.

Cause

A common cause of this is that the SUBSCHEMA-xxxNAMES control blocks are being passed as linkage parameters from the main program to the sub program.

Resolution

It is a common programming technique when passing control from a main cobol program to a subordinate cobol program, to "extend" the run-unit so that the sub-program inherits the run-unit that the main program is using.

When doing this, only SUBSCHEMA-CTRL and any required user-defined database record descriptions should be passed as linkage parameters. Some clients also pass the SUBSCHEMA-xxxNAMES control blocks. This is not a good practice.

The only purpose of the SUBSCHEMA-xxxNAMES control blocks copied into cobol programs is to define the constants, with appropriate VALUE clauses, that will be referenced by the DML statement expansions.

If, for example, SUBSCHEMA-SETNAMES is passed, it is possible that the sequence of the dictionary records representing the subschema were not the same at the time the two programs were compiled. As the VALUE clauses are not copied into the program when being included in the LINKAGE SECTION, the sub-program will inherit the sequence of the value clauses as they were at the time the main program was compiled. This may not align with the expansion of SUBSCHEMA-SETNAMES in the sub-program.

This can result in inconsistent values being passed in DML statements in the sub-program, and xx08 error-status values.

The SUBSCHEMA-xxxNAMES structures should not be passed as LINKAGE parameters. They should be copied independently and directly into WORKING STORAGE of each program that requires them.

Additional Information

WORKING-STORAGE and LINKAGE SECTIONS