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
 

 

VSAM - File opening Error 37

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

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jun 25, 2012 10:06 am    Post subject: VSAM - File opening Error 37
Reply with quote

Hi,

I am creating a CICS cobol program which is parsing the XML script and writing into VSAM. The program working fine for first time run. When I tried to run 2nd time, its abended with error "File opening error 37".
In Cobol , key as 1 and cobol data items are written to VSAM file (only 1 record - Everytime). I have tried to delete the vsam file and run it. For first time, its working fine. Second time its giving the same error.

Please help me.
Back to top
View user's profile Send private message

Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Mon Jun 25, 2012 10:36 am    Post subject:
Reply with quote

You say you run it in CICS. Files in CICS are handled by the CICS system, and thus no Open, Select and FD should be present in the COBOL-program.
I wonder why you say you get "File opening error 37", when your program shouldn't open the file at all?
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jun 25, 2012 10:55 am    Post subject:
Reply with quote

Sorry, its COBOL program. Not a CICS COBOL program.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Mon Jun 25, 2012 11:04 am    Post subject: Reply to: VSAM - File opening Error 37
Reply with quote

Please post SELECT, FD, OPEN, WRITE/READ statements from the program, with the code tags.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Mon Jun 25, 2012 11:07 am    Post subject:
Reply with quote

If you show the IDCAMS definition and the program code, someone may help you.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Jun 25, 2012 3:55 pm    Post subject: Reply to: VSAM - File opening Error 37
Reply with quote

Review this LINK -

http://ibmmainframes.com/viewtopic.php?t=32811
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon Jun 25, 2012 4:34 pm    Post subject:
Reply with quote

Hi,

Please find the IDCAMS, FD, SELECT, open, write and Close.


Code:
DEFINE CLUSTER (NAME(H326556.TEST.XMLPARSR) -                 
       CYLINDERS(10 20) -                                     
       BUFFERSPACE(20) -                                       
       CONTROLINTERVALSIZE(10) -                               
       KEYS(5 0) -                                             
       RECORDSIZE(1000 1000) -                                 
       ) -                                                     
       DATA (NAME(H326556.TEST.XMLPARSR.DATA) -               
       ) -                                                     
       INDEX (NAME(H326556.TEST.XMLPARSR.INDEX) -             
       ) 



Code:
   SELECT WS-OPFILE ASSIGN TO VSAMFILE                     
   ORGANIZATION IS INDEXED                                 
   ACCESS MODE IS RANDOM                                   
   RECORD KEY IS OP-XMLID                                 
   FILE STATUS IS WS-OPFILE-SW.                           


                             
  FD WS-OPFILE.               
  01 OP-XML-REC.             
     05 OP-XMLID   PIC 9(5). 
     05 OP-XMLDATA PIC X(995).


 1111-OPEN-FILE.                                             
                                                             
     INITIALIZE WS-OPFILE-SW WS-OPXML-REC WS-EOF-SW.         
     OPEN OUTPUT WS-OPFILE.                                 
     IF WS-OPFILE-SW = '00'                                 
        DISPLAY "FILE OPEN SUCCESSFUL"                       
     ELSE                                                   
        DISPLAY "FILE OPENING ERROR " WS-OPFILE-SW           
        GO TO 0000-EXIT                                     
     END-IF.                                                 
                                                             
 1111-EXIT.                                                 
     EXIT.   

           
3000-WRITE-DATA.                                     
      MOVE 1 TO OP-XMLID                               
      MOVE WS-OPXML-REC TO OP-XMLDATA                   
      WRITE OP-XML-REC.         

*
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Jun 25, 2012 5:00 pm    Post subject: Reply to: VSAM - File opening Error 37
Reply with quote

CONTROLINTERVALSIZE of 10?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7906
Location: Bellevue, IA

PostPosted: Mon Jun 25, 2012 5:34 pm    Post subject:
Reply with quote

Bill, at least it matches the BUFFERSPACE(20) (LOL).

Thamilselvi1982, CISIZE can only take certain values -- and 10 is NOT one of those values. Most likely, the CISIZE is being increased but I'd like to see a LISTCAT on the file just to see what got used. Furthermore, what does the JCL to execute your program look like -- in particular, the DD statement used for your VSAM file?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Mon Jun 25, 2012 5:40 pm    Post subject: Reply to: VSAM - File opening Error 37
Reply with quote

I tried your program with VSAM extended file status code and the below were the results.

Code:
FILE OPENING ERROR 37                         
EXTENDED VSAM-CODE ==>RETURN: 08
COMPONENT: 0
REASON: 232


232 code indicates the below(from VSAM Demystified manual)
Code:
232 Reset (ACB MACRF=RST) was specified for a
nonreusable data set and the data set is not empty.

Guys, Please correct me if I'm wrong.
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Tue Jun 26, 2012 3:29 pm    Post subject:
Reply with quote

Try an IDCAMS ALTER cluster.name REUSE on the file, but first RTFM (VSAM Demystified) to understand how it works

Note that REUSE has a different effect when writing to the file with an application program depending on the type of processing selected, or in a Batch load (REPRO) for example where it is like DISP=OLD in JCL and will overwrite the file from the beginning. (resets HURBA to 0)

CISIZE can only be multiples of 512 bytes. Best to omit the CISIZE and allow IDCAMS to select the correct value, unless it is used in CICS and you may want to select a CISIZE that has an equivalent CICS buffer pool size.
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 S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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