Program Receiving 9/107 Error on OPEN OUTPUT

0 Likes

This article describes a possible reason for the run-time system error 9/107 and a potential work around.

Problem:

COBOL programs were compiled using the CREATEXFD and CALLFH (ACUFH) directives as required for Database Connectors. An XFD file was generated. The database being accessed was Oracle 10g.The program received a 9/107 error on OPEN OUTPUT, but a table was created in the database. The Consolidated Trace Facility (CTF) log (rts32.textfile.PID.log) revealed the following generated SQL:

CREATE TABLE ... succeeds
ALTER TABLE MYTABLE ADD CONSTRAINT iMYTABLE_0 PRIMARY KEY () ... fails: ORA-00936: missing expression

Resolution:

Examining the COBOL program source revealed that the VAR-LENGTH XFD directive had been misplaced, causing the Compiler to generate an invalid XFD file. Note the difference in the position of the VAR-LENGTH directive in the examples below. Example 2 shows the correct location.

Example 1

            03 MY-SERVICE REDEFINES MY-SERVICE-RE 
$XFD VAR-LENGTH
PIC X(20) OCCURS 2 TIMES.

Example 2

          $XFD VAR-LENGTH 
03 MY-SERVICE REDEFINES MY-SERVICE-RE
PIC X(20) OCCURS 2 TIMES.

Repositioning the VAR-LENGTH directive to match Example 2 allowed the Compiler to generate a valid XFD file and the successful execution of the program.

Incident Number: 2285108

Old KB# 14462
Comment List
Related
Recommended