View previous topic :: View next topic
|
Author |
Message |
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
Sorry, its COBOL program. Not a CICS COBOL program. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Please post SELECT, FD, OPEN, WRITE/READ statements from the program, with the code tags. |
|
Back to top |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
If you show the IDCAMS definition and the program code, someone may help you. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
CONTROLINTERVALSIZE of 10? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
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 |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
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 |
|
|
|