IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

VSAM file opening file status 39


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Tue Sep 23, 2008 5:50 pm
Reply with quote

Hi ,

I am rying to open a VSAM file for write. But it is giving me a file status 39 inspite of the file attributes matching. Does any one know any other reason why the VSAM file open error is happening.

*
* Input - Output file
*
Code:
     SELECT OUTPUT-VSAM-FILE  ASSIGN  OUTDD
            ORGANIZATION         IS   INDEXED
            ACCESS MODE          IS   DYNAMIC
            RECORD KEY           IS   WSAA-GA-CODE6
            ALTERNATE RECORD KEY IS   WSAA-ABI-CODE
            FILE STATUS          IS   WS-OUTPUT-STAT.

*
*
Code:
 FD  OUTPUT-VSAM-FILE
     RECORD CONTAINS 110 CHARACTERS
     DATA RECORD IS WSAA-ALTMMTBL-REC.

*
Cluster definition
===========
Code:
  DEFINE CLUSTER (NAME(ISTEST.ABI.TEST.MMODEL4)          -
                  CYLINDERS(20,10)                       -
                  CONTROLINTERVALSIZE(4096)              -
                  FREESPACE(10,20)                       -
                  KEYS(6,8)                              -
                  RECORDSIZE(110,110))                   -
         DATA    (NAME(ISTEST.ABI.TEST.MMODEL4.DATA))    -
         INDEX   (NAME(ISTEST.ABI.TEST.MMODEL4.INDEX)    -
                  CONTROLINTERVALSIZE(1024))
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 23, 2008 5:58 pm
Reply with quote

Quote:
But it is giving me a file status 39 inspite of the file attributes matching
Wrong. You think the file attributes match. COBOL disagrees, which is why you got the 39 file status. And you did not post key data -- the 01 definition for the file under FD OUTPUT-VSAM-FILE. Furthermore, your COBOL code references an alternate record key but you did not post the definition for it, either. If you don't have an alternate index on the file, remove the ALTERNATE RECORD KEY clause.
Back to top
View user's profile Send private message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Tue Sep 23, 2008 6:20 pm
Reply with quote

Alternate index has also been defined.

Code:
  DEFINE AIX (NAME(ISTEST.ABI.TEST.MMODEL4.ABI.AIX)         
              RELATE(ISTEST.ABI.TEST.MMODEL4)               
              CYLINDERS(10,10)                             
              CONTROLINTERVALSIZE(4096)                     
              FREESPACE(10,20)                             
              KEYS(8,0)                                     
              NONUNIQUEKEY                                 
              UPGRADE                                       
              RECORDSIZE(19,613))                         
         DATA (NAME(ISTEST.ABI.TEST.MMODEL4.ABI.AIX.DATA)) 
         INDEX (NAME(ISTEST.ABI.TEST.MMODEL4.ABI.AIX.INDEX))


01 definition is
Code:
 FD  OUTPUT-VSAM-FILE
     RECORD CONTAINS 110 CHARACTERS
     DATA RECORD IS WSAA-ALTMMTBL-REC.
*
 01 WSAA-ALTMMTBL-REC.
    03 WSAA-ABI-CODE             PIC 9(08).
    03 WSAA-GA-CODE6.
       05 WSAA-GA-CODE6-2        PIC X(02).
       05 WSAA-GA-CODE6-4        PIC X(04).
    03 WSAA-LOOKUP-KEY           PIC X(08).
    03 WSAA-START-YEAR-IN        PIC 9(02).
    03 WSAA-GA-CODE2             PIC X(02).
    03 WSAA-GA-CODE-PART2        PIC X(02).
    03 WSAA-CC                   PIC 9(04).
    03 WSAA-GA-GROUP             PIC X(03).
    03 WSAA-ABI-GROUP            PIC X(03).
    03 WSAA-CONTROL-IND          PIC X(01).
    03 WSAA-START-YEAR           PIC 9(02).
    03 WSAA-WITHDRAW-YEAR        PIC X(02).
    03 WSAA-MAKE                 PIC X(14).
    03 WSAA-MODEL                PIC X(30).
    03 WSAA-MODEL-TYPE           PIC X(05).
    03 WSAA-FULL-TYPE            PIC X(01).
    03 WSAA-TRANSMISSION         PIC X(01).
    03 WSAA-AA-CODE4             PIC X(04).
    03 WSAA-AA-GROUP             PIC X(03).
    03 WSAA-FILLER               PIC X(09).
*

File attributes seem to be matching but it still gives the status code 39. Can you please help
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 23, 2008 6:23 pm
Reply with quote

Now we're making progress. So what's the JCL look like for the file?
Back to top
View user's profile Send private message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Tue Sep 23, 2008 6:26 pm
Reply with quote

the JCL used is
Code:
//U2138    EXEC PROC=PDM,PROG=WU2138,RC=',COND=(8,LT)'
//*
//PDM.SLG1 DD  DUMMY
//INDD     DD  DSNAME=ISTEST.CR10050.ABICODE.CSV1.OUTFILE1,
//             DISP=SHR
//OUTDD    DD  DSNAME=ISTEST.ABI.TEST.MMODEL3,
//             DISP=MOD
//OUTDD1   DD  DSNAME=ISTEST.ABI.TEST.MMODEL4.ABI.PATH,
//             DISP=MOD


the path has also been defined.
Code:
DEFINE PATH      (NAME(ISTEST.ABI.TEST.MMODEL4.ABI.PATH)
       PATHENTRY (ISTEST.ABI.TEST.MMODEL4.ABI.AIX)     
       UPDATE)
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Sep 23, 2008 6:28 pm
Reply with quote

DISP=MOD on a VSAM file? That doesn't seem right.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 23, 2008 6:40 pm
Reply with quote

Yeah, Kevin, I think DISP=OLD would be better. DISP=MOD on a VSAM alternate index? The mind boggles.

Chethana, try DISP=OLD for OUTDD and OUTDD1.
Back to top
View user's profile Send private message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Tue Sep 23, 2008 6:49 pm
Reply with quote

This doesnt work either. icon_sad.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 23, 2008 7:20 pm
Reply with quote

Chethana, are you getting any messages in the log about the file? I'm thinking there might be an IEC161I that might explain something.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 24, 2008 1:31 am
Reply with quote

Hello,

Code:
//OUTDD    DD  DSNAME=ISTEST.ABI.TEST.MMODEL3,
Is this a typo or is there such a dataset for some other vsam file?
Back to top
View user's profile Send private message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Wed Sep 24, 2008 8:52 am
Reply with quote

Robert ,

yes there is IEC161I in the spool for the run of this job. Can you please advice what this could mean?
Back to top
View user's profile Send private message
Chethana

New User


Joined: 26 Nov 2007
Posts: 6
Location: Bangalore

PostPosted: Wed Sep 24, 2008 8:55 am
Reply with quote

Dick ,

That was just a typo. There is a dataset for that VSAM file.

Thank You
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 24, 2008 9:15 am
Reply with quote

Hello,

At the top of the page there is a link to "IBM Manuals". At the bottom of that page is a set of documentation for "MVS System Messages".

This is a link to a page that explains the IEC161I message:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/iea4h406/2.85?

You may need to use other parts of the documentation as well.

I recommend becoming familiar and comfortable with the manuals - they can save you a lot of time. Someone will be here when there are questions, but you may often get a useful answer much quicker using the manual(s).

Good luck icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 24, 2008 5:47 pm
Reply with quote

What's the IEC161 message(s)? There's codes in it that explain a lot of the problem, usually.

Also, is the typo in the JCL or just what you posted? If you're using one file with a different file's alternate index, that would definitely cause a 39 file status.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top