Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting file open error '39' for VSAM with alternate key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue May 06, 2008 2:25 pm    Post subject: Getting file open error '39' for VSAM with alternate key
Reply with quote

Hi,

I have a file with the following record layout.

01 WS-FILE-REC.
03 WS-ORIG-KEY.
05 WS-DFTA-SEQ-NO PIC S9(9) COMP.
05 WS-DFTA-CA-NO-KEY PIC X(11).
03 WS-DATA-PART PIC X(965).

Here, WS-ORIG-KEY is the actual key of the vsam.
and WS-DFTA-CA-NO-KEY is the alternate key.

While reading this file in program, it is giving file status error '39'.

Please let me know the reason for this.

Thanks.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue May 06, 2008 3:17 pm    Post subject:
Reply with quote

Try looking at the COBOL File Status Codes
Back to top
View user's profile Send private message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue May 06, 2008 3:59 pm    Post subject:
Reply with quote

Hi,

I did check for the reason for status code 39. But i am unable to find what is going wrong.


My primary key is WS-ORIG-KEY, which is a combination of PIC S9(9) COMP and PIC X(11). So i have given the key as
INDEXED -
KEYS(14 1) -

in my vsam cluster definition.

The alternate key is WS-DFTA-CA-NO-KEY PIC X(11).
It is defined as below
KEYS(11 4) -

Once the vsam with alternate key is created and tried to open through program i am getting this status code 39.

also, in my jcl i have mentioned the vsam and the path also for using this alternate key.

Kindly, guide me on this.

Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue May 06, 2008 4:37 pm    Post subject:
Reply with quote

what do your select and fd entries look like? also the jcl for the step execution of this program.
Back to top
View user's profile Send private message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue May 06, 2008 4:50 pm    Post subject:
Reply with quote

Hi,

Please find below the SELECT and FD entries.
SELECT ICRS-FILE ASSIGN TO ICRSVSM
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS
WS-ORIG-KEY
ALTERNATE KEY IS WS-DFTA-CA-NO-KEY
WITH DUPLICATES
FILE STATUS WS-VSAM-FILE-STATUS.


FD ICRS-FILE.
*
01 WS-ICRS-REC.

03 WS-ORIG-KEY.
05 WS-DFTA-SEQ-NO PIC S9(9) COMP.
05 WS-DFTA-CA-NO-KEY PIC X(10).
03 WS-DATA-PART PIC X(965).

In my jcl i have given the VSAM and the path name also.
//ICRSVSM DD DSN=DACCAR.Z.HOKO.CYC7.DEC07.VSAM,
// DISP=SHR
//ICRSVSM1 DD DSN=DACCAR.Z.HOKO.CYC7.DEC07.VSAM.PATH,
// DISP=SHR

Not sure if the PIC S9(9) COMP is creating probs.

Thanks.
Back to top
View user's profile Send private message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue May 06, 2008 4:51 pm    Post subject:
Reply with quote

Hi,

Putting the FD entries once again due to a mistake.
FD ICRS-FILE.
*
01 WS-ICRS-REC.

03 WS-ORIG-KEY.
05 WS-DFTA-SEQ-NO PIC S9(9) COMP.
05 WS-DFTA-CA-NO-KEY PIC X(11).
03 WS-DATA-PART PIC X(965).

Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue May 06, 2008 5:19 pm    Post subject:
Reply with quote

well, enrico or cics_guy will have to come along and save your butt,

but, how do you expect your cobol program to access (or even use) the following DD statement from your jcl?
Code:

//ICRSVSM1 DD DSN=DACCAR.Z.HOKO.CYC7.DEC07.VSAM.PATH,
// DISP=SHR
Back to top
View user's profile Send private message
rosmi joseph

New User


Joined: 17 Sep 2007
Posts: 68
Location: Kochi

PostPosted: Tue May 06, 2008 5:24 pm    Post subject:
Reply with quote

I am not really sure. I havent worked on Alternate index before.
Please guide me as to what change is needed in program.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us