View previous topic :: View next topic
|
Author |
Message |
bryan_lab Currently Banned New User
Joined: 12 May 2007 Posts: 3 Location: Philippines
|
|
|
|
Hi,
Can someone help me with this? This is my first time to do a CICS program and I'm having a problem updating the record sequentially.
These are what I have done with my program:
1. Issue a start browse to start from the first record.
2. Perform read next until end of file.
2.a. Update that record using the rewrite.
My problem is when I'm updating the record that I have read, I'm encountering an INVREQ. I don't know what to do with this.
I'll appreciate if someone can help me with this.
Thanks. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
If you've reached end of file, you don't have a record available to rewrite. You haven't given enough information in order for someone to help you. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You don't really provide a very good explanation of what's going on -- for example, the manual says about REWRITE:
Quote: |
Description
REWRITE updates a record in a file on a local or a remote system. You must always precede this command with a read with the UPDATE option.
For VSAM data sets, you must not change the key field in the record. |
You don't say you've done a READ with UPDATE which is required per the manual. And I agree with Terry -- if you hit end of file, you don't have a record to rewrite, anyway. |
|
Back to top |
|
|
bryan_lab Currently Banned New User
Joined: 12 May 2007 Posts: 3 Location: Philippines
|
|
|
|
Hi,
Sorry for that. it's like this:
1. startbr (start from the first record)
2. read next
3. Perform process-rtn until end of file
process-rtn.
validate and rewrite
read next
My problem is for the first read (I'm sure it will be a problem also on the succeeding records). let's say i have read from record number 1. after i validate it and it's ok, i need to update that record. I'm encountering an INVREQ on the rewrite command. when i checked the response code, it's 16.
Thanks.
Bryan |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What's the RESP2 field? That'll tell you per the manual exactly why the rewrite is failing. However, as I said in my first post, if you do not READ or READNEXT the record with UPDATE, your REWRITE will fail. Period. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
you need to end the browse before performing the update, and then
start browse again.
Process-rtn.
validate
endbrowse
read/update
start browse
readnext |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please do not post the same question in both forums. . .
Thank you,
d.sch. |
|
Back to top |
|
|
bryan_lab Currently Banned New User
Joined: 12 May 2007 Posts: 3 Location: Philippines
|
|
|
|
Hi All,
Thanks for all your response. I'll try what Earl has suggested.
dick scherrer,
I do apologize for that.
Thanks again. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I do apologize for that. |
Not to worry
The "post police" are here to keep an eye out. . .
Good luck,
d |
|
Back to top |
|
|
|