VSAM ERROR RC="39"



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

VSAM ERROR RC="39"

Postby harishcv » Mon Jan 24, 2011 6:14 pm

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.
harishcv
 
Posts: 11
Joined: Wed Dec 29, 2010 1:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM ERROR RC="39"

 

Re: VSAM ERROR RC=39

Postby Robert Sample » Mon Jan 24, 2011 6:29 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: VSAM ERROR RC=39

Postby harishcv » Mon Jan 24, 2011 6:43 pm

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.
harishcv
 
Posts: 11
Joined: Wed Dec 29, 2010 1:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM ERROR RC=39

Postby Robert Sample » Mon Jan 24, 2011 6:51 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post