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

VSAM - File opening Error 37


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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: 792
Location: Chennai, India

PostPosted: Mon Jun 25, 2012 11:04 am
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jun 25, 2012 3:55 pm
Reply with quote

Review this LINK -

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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jun 25, 2012 5:00 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jun 25, 2012 5:34 pm
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: 792
Location: Chennai, India

PostPosted: Mon Jun 25, 2012 5:40 pm
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 Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Tue Jun 26, 2012 3:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
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 Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top