View previous topic :: View next topic
|
Author |
Message |
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Hi,
I am trying to write into a KSDS VSAM file and I am getting file status of 16. I am running this program in the CICS environment. Can somebody please help figuring out this error? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you should be interrogating the resp and resp2 codes from the CICS API CALL for the vsam i/o. CICS documentation (top of page) will tell you what the error codes mean.
16 is not a valid file-status code - which is a cobol thing. |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Thanks for the immediate response.. I am thinking that what I am getting is a file-status error itself. Below is the part of the cobol program that is failing in the CICS envoronment. I found the exact location in error by running the program through CICS EXPEDITOR..
=======================
IF (WS-TEXT-1-0001XX = 'Y')
EXEC CICS WRITE
FROM (OUT-PUT)
RIDFLD (WS-KEY-FLD)
LENGTH (WS-LENGTH)
FILE ('RXRTEST')
RESP (WS-WRTE-RESP)
END-EXEC
========================
The "ws-wrte-resp" has +0000016 at the end of execution. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you checked the manual, which can be reached from the link at the top of the page, you would find that a 16 RESP value is INVREQ. If you then further checked the manual on the WRITE command, you would find you need to interrogate RESP2 to get more details about the error:
Quote: |
INVREQ
RESP2 values:
20
Add operations are not allowed according to the file entry specification in the FCT.
23
When writing records containing embedded keys, the key in the record area (FROM option) and the key in RIDFLD do not match.
26
The KEYLENGTH option is specified, and the specified length does not equal the length defined for the data set that this file refers to.
38
A WRITE with the MASSINSERT option is issued against a BDAM file.
40
A BDAM key conversion error occurred.
44
The WRITE command does not conform to the format of WRITE for a user-maintained or coupling facility data table (for example, MASSINSERT or RBA is specified).
51
A WRITE command specifying the RBA keyword was issued against a KSDS file that is being accessed in RLS mode. RLS mode does not support relative byte address access to KSDS files.
55
NOSUSPEND is not allowed because the file is not a VSAM file that is accessed in RLS mode.
56
An attempt to update a recoverable coupling facility data table has failed because the current unit of work has already updated 1024 recoverable coupling facility data tables. You cannot update more than 1024 recoverable coupling facility data tables within a unit of work
59
XRBA was specified, but the data set is not an extended addressing ESDS.
Default action: terminate the task abnormally. |
|
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Thanks a lot!. I figured the issue.. Looks like I have to explicitely specify the value of the length of the VSAM file..Like below,
EXEC CICS
...
LENGTH(100)
...
END-EXEC
Previously I was calling through a WS variable -- LENGTH(WS-LENGTH)
Its quite strange!!, but looks like this was the issue. When I give 100, it works perfectly! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
LENGTH can take a variable -- I've done so many times. Did you define the variable WS-LENGTH as PIC S9(04) COMP and move 100 to it before doing the WRITE? If not, that could explain the results. |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
I declared it as PIC 9(3) VALUE 100. Could that be an issue? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Oh, very definitely. The hex value of 100 that CICS was expecting was 0064 but you fed it F1F0 -- not at all the same value and negative to boot. The INVREQ makes a lot of sense when you try to write a negative number of bytes to a file. The definition should be PIC S9(04) COMP VALUE +100. |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Great info!.. Thanks a lot Robert! |
|
Back to top |
|
|
|