Page 1 of 1

VSAM ERROR RC="39"

PostPosted: Mon Jan 24, 2011 6:14 pm
by harishcv
Hi,

Could anyone please help me to understand what exactly is RC=39.

VSAM ERROR RC=39
IGZ0020S A logic error occurred. Neither FILE STATUS nor a declarative was specified.

Re: VSAM ERROR RC=39

PostPosted: Mon Jan 24, 2011 6:29 pm
by Robert Sample
Assuming this is a file status 39, the meaning (from the COBOL Language Reference manual) is:
The OPEN statement was unsuccessful because a conflict was detected
between the fixed file attributes and the attributes specified for that
file in the program. These attributes include the organization of the
file (sequential, relative, or indexed), the prime record key, the
alternate record keys, the code set, the maximum record size, the record
type (fixed or variable), and the blocking factor.


Professional programmers learn to use every bit of data available when debugging -- hence they put FILE STATUS clauses in all their programs. You would be wise to add it to yours.

Re: VSAM ERROR RC=39

PostPosted: Mon Jan 24, 2011 6:43 pm
by harishcv
Thanks Robert.

I am not using any alternate index, I am just trying to open a simple VSAM KSDS file.

Couldnt actually get what exactly the issue is. I tried with other similar files, but facing issuw with only a particular file.

Please let me know if something strikes to you or for any additional information.

Re: VSAM ERROR RC=39

PostPosted: Mon Jan 24, 2011 6:51 pm
by Robert Sample
You read that entire message and picked out alternate index as the issue? That is defintely a case of putting blinders on!

Possible problems include:
1. your COBOL program and the VSAM file have the primary key starting in different locations
2. your COBOL program and the VSAM file have the primary key lengths different
3. your COBOL program and the VSAM file have different record formats (one being fixed and the other being variable -- and either could be fixed)
4. your COBOL program and the VSAM file have different maximum record lengths (if variable) or record lengths (if fixed)
5. your COBOL program specified other attributes not compatible with the VSAM file

If you cannot figure out the problem, post the output of a LISTCAT as well as the COBOL program SELECT statement and FD for the VSAM file.