View previous topic :: View next topic
|
Author |
Message |
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
i am getting error in rewrite function. i have done the below steps
step1:
Code: |
EXEC CICS READ
UPDATE
FILE ('file name')
INTO (FILE-AREA)
RIDFLD (WS-FULL-KEY)
LENGTH (WS-FILE-LENGTH)
KEYLENGTH (LENGTH OF WS-FULL-KEY)
RESP (WS-RESPCODE)
END-EXEC.
|
The read update is fine and it return code as zero.
STEP2:
TRYING TO REWRITE
Code: |
EXEC CICS REWRITE
FILE ('file name')
FROM (FILE-AREA)
LENGTH (WS-FILE-LENGTH)
RESP (WS-RESPCODE)
END-EXEC.
|
getting error while rewriting
getting EIBRESP=16 EIBRESP2=30
Thanks in advance. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
'INVREQ' code returned = D2X(16)
Quote: |
INVREQ
RESP2 values:
30
A REWRITE command is issued without a token and no previous READ for UPDATE (also without a token) can be found.
A possible reason for the previous READ for UPDATE not being found is that it failed for some reason, and the failure has not been correctly handled or has been ignored. |
1. RESP codes can be found here:
The above quoted document further wrote: |
EIBRESP2
contains more detailed information that may help explain why the RESP condition occurred. This field contains meaningful values, as documented with each command to which it applies |
suggest you save the url for EIB FIELDS
by the way, how are you getting the RESP2 value
since you have not coded the API CALL to return it to your program?
If indeed your READ for UPDATE was error free,
you are dong something to the file between the READ and REWRITE.
as far as the 'token' thing is concerned, either look-it-up for wait for someone else to respond. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you are not changing anything in the key are you? |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Hi Dick,
My problem is, I am having partial key alone and the full key are storing in linkage variable.. Before read update i moved the full key into actual file key...after that i am updating some non key variable in file and then trying to rewrite the file.. |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Hi Dick,
I need the link which you got the below info
Quote: |
INVREQ
RESP2 values:
30
A REWRITE command is issued without a token and no previous READ for UPDATE (also without a token) can be found.
A possible reason for the previous READ for UPDATE not being found is that it failed for some reason, and the failure has not been correctly handled or has been ignored. |
But the link which you gave contains just few info about EIBRESP2. I need detail info for each code as you mentioned. Can you please provide that link?
Thanks in advance |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as documented with each command to which it applies |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Thanks Dick for your quick reply.
Please help me in rewrite issue also...
Is it possible to rewrite a file with partial key Since i am updating the key values? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i don't understand how a READ with a partial key,
with the alternatives EQUAL and GTEQ where EQUAL is the default,
works.
so, other than provide links, i am out of this discussion.
you never explained how you arrive at the RESP2 value. |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Sorry Dick, as you said the read step is not fine..it return as record not found..so that only i got resp2 as 30 in rewrite step...
I heard we can read a file with partial key with GENERIC option. Is it possible to rewrite a VSAM KSDS file after updating its key value?
I am having a VSAM KSDS file key which contains 5 fields.In that we can update all the fields other than 1st field.
So is it possible read that file with 1st field and update other 4 fields even they are key fields with REWRITE function. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you review what you asked, you'll surely come to the correct answer. |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Ok Dick...
Just let me know, Is it possible to update a key of KSDS file in a program? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Just let me know, Is it possible to update a key of KSDS file in a program? |
Uh, no! The key cannot be changed by a REWRITE. If you change even one single byte of the key, you must do a WRITE since that is a new record, it is not an existing record. |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Thank you very much Dick ! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Are you just calling everyone Dick?
If you want to "logically" rewrite the record (so you have to insert a new record), remember to delete the original as well. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Are you just calling everyone Dick?
|
maybe he is calling everyone a dick,
since he has been treating us like one. |
|
Back to top |
|
|
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Oh i am really sorry! Thank you all |
|
Back to top |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
Good day to all!
On the read, move the 'UPDATE' after the file-name and add a GTEQ because you using a partial key. On the rewrite, eliminate the 'RESP'. Let us know if it worked. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Jose: your suggestions won't work, and taking the RESP off is bad coding practice, anyway. As previously posted, the o/p is attempting to change part of the key (past the generic read part) and hence the REWRITE cannot, under any circumstances, work. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I feel that the TOKEN concept is a very underutilized parameter.
it is similiar to the ID used in ISPF LMM... routines
and HANDLE in MQS.
I say similar because TOKEN refers to a RECORD
where as the ISPF ID refers to the file/PDS/PDSE
and MQS refers to the QUEUE within a QUEUE Manager.
For some reason, many do not understand.
Still, as Robert (and everyone else) has said,
regardless,
you can not rewrite a record with a different key,
because that would be a write (insert). |
|
Back to top |
|
|
|