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

Getting file status of 16 while writing into KSDS VSAM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Oct 06, 2008 3:13 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 06, 2008 3:35 pm
Reply with quote

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
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Oct 06, 2008 3:50 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Oct 06, 2008 4:51 pm
Reply with quote

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
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Oct 06, 2008 5:36 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Oct 06, 2008 5:56 pm
Reply with quote

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
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Oct 06, 2008 6:14 pm
Reply with quote

I declared it as PIC 9(3) VALUE 100. Could that be an issue?
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 Oct 06, 2008 6:20 pm
Reply with quote

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
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Oct 06, 2008 6:35 pm
Reply with quote

Great info!.. Thanks a lot Robert!
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 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