Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reading/updating records from a VSAM file sequentially error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
bryan_lab
Currently Banned

New User


Joined: 12 May 2007
Posts: 3
Location: Philippines

PostPosted: Tue Nov 18, 2008 7:07 am    Post subject: Reading/updating records from a VSAM file sequentially error
Reply with quote

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

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Nov 18, 2008 7:58 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 18, 2008 8:09 am    Post subject:
Reply with quote

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

New User


Joined: 12 May 2007
Posts: 3
Location: Philippines

PostPosted: Tue Nov 18, 2008 8:11 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 18, 2008 8:32 am    Post subject:
Reply with quote

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

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Tue Nov 18, 2008 8:38 am    Post subject:
Reply with quote

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 18, 2008 8:39 am    Post subject: Reply to: Reading/updating records from a VSAM file sequenti
Reply with quote

Hello,

Please do not post the same question in both forums. . .

Thank you,

d.sch.
Back to top
View user's profile Send private message
bryan_lab
Currently Banned

New User


Joined: 12 May 2007
Posts: 3
Location: Philippines

PostPosted: Tue Nov 18, 2008 8:48 am    Post subject:
Reply with quote

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 18, 2008 9:41 am    Post subject: Reply to: Reading/updating records from a VSAM file sequenti
Reply with quote

Hello,

Quote:
I do apologize for that.
Not to worry icon_smile.gif

The "post police" are here to keep an eye out. . .

Good luck,

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us