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

READ ERROR TO RANDOMLY ACCESSED RECORD IN VSAM FILE


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

New User


Joined: 13 Apr 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Sep 02, 2009 6:13 pm
Reply with quote

Hi,

I have a problem like during my batch run, one particular job is trying to read file for a particluar record and when that record is not found, job fails with u999 giving STA=23.

After few minutes without any fix when I restart the job, job goes fine.

Can anyone tell me why it has happened.

Thanks/Jai
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: Wed Sep 02, 2009 6:43 pm
Reply with quote

Is the file updated online while the batch program is accessing it? If so, the online system might be adding records that are interfering with the batch processing. If not, then your program has some combination of conditions that cause the record key it attempts to read to be invalid (as in, not found in the file). Finding those conditions requires scanning the source code to find out what is causing the issue -- also known as debugging.

The bigger issue in my mind is why does the program abend when it cannot find a record -- shouldn't it just display an error message and continue?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 02, 2009 6:43 pm
Reply with quote

probably has to do with the 7th record in the file.
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: Wed Sep 02, 2009 7:39 pm
Reply with quote

No Dick, since the 7th record is not there, it's the 8th record. icon_lol.gif
Back to top
View user's profile Send private message
JAYADEV.G

New User


Joined: 13 Apr 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Sep 02, 2009 8:16 pm
Reply with quote

common people don't play games. I am having genuine problem please try to help me.
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: Wed Sep 02, 2009 8:22 pm
Reply with quote

I don't want to speak for Dick, but I suspect both he and I are trying to say that you didn't provide enough information in your original post to be of much help. Please follow Robert's debugging suggestion.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 02, 2009 8:23 pm
Reply with quote

Jayadev,

your basic problem is defining the problem.
Back to top
View user's profile Send private message
JAYADEV.G

New User


Joined: 13 Apr 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Sep 02, 2009 8:33 pm
Reply with quote

dick,

let me explain u again what my problem is

during my batch processing, one of the batch job is trying to read a record of particular file, it failed because it could not find record.

When i restarted the job , it went fine.This job has only one step.
I have checked whether that particular record is being maintained in online.But it is'n the case.

so what could be the reason that is what for i have posted this query.

I think Dick Brenholtz u understood what my query is.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Sep 02, 2009 8:41 pm
Reply with quote

Quote:
to read a record of particular file

what kind of file?
what kind of read?
Select, FD statements and I/O commands used.

Quote:
it failed because it could not find record.


failed? what is the file status after your read? are you using the simple
2 char file status or the expanded file status clause?

what are the responses you receive in the status fields?

Quote:
I have checked whether that particular record is being maintained in online.But it is'n the case.


maintained?

is the record in the file or not?

if vsam, what are the share options?

Still don't have enough info to make a suggestion.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 02, 2009 8:43 pm
Reply with quote

investigate the approach suggested by Robert in the first reply,

You are expecting too much, giving too little icon_evil.gif
Back to top
View user's profile Send private message
JAYADEV.G

New User


Joined: 13 Apr 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Sep 02, 2009 9:47 pm
Reply with quote

Hi Dick,


1)File is VSAM file. It was read in Dyn Input mode.
Select clause does not have any info except file name.
FD also does not have file length except that file layout is mentioned.

2)File status is 23. I am using simple 2 char file status.

I did not get this query
"what are the responses you receive in the status fields?"

3)File is not maintained.Record is also not found in the file.
VSAM file SHAREOPTIONS(2,3).

DICK I think I have provided details which u require.I am ready to provide whatever details u want. Thing is that i want to resolve this issue. Guys please help me.

Thanks/Jai
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: Wed Sep 02, 2009 9:49 pm
Reply with quote

Quote:
I have checked whether that particular record is being maintained in online.But it is'n the case.
Uh, you ARE aware, aren't you, that VSAM implements locking at the CI level, not the record level -- so your statement here is absolutely, categorically nonsense. ANY record in the CI being updated online would result in your record not being available -- not just the one you're looking at. Depending upon the record length and the CI size, that could be quite a few records.
Back to top
View user's profile Send private message
JAYADEV.G

New User


Joined: 13 Apr 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Sep 02, 2009 10:04 pm
Reply with quote

hi TANSTAAFL

so you mean to say that record is definetly maintained.

Can u explain this in a bit detailed manner
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: Wed Sep 02, 2009 11:04 pm
Reply with quote

Depending upon the VSAM parameters (record length, CI size, free space), there could be anywhere from 1 to thousands of VSAM records in a single CI. When VSAM is updating a record (online or batch), the entire CI is locked -- not just the one record being changed. And without looking at a lot of hex values, you do not know which records are in which CI unless you've just unloaded and reloaded the VSAM (in which case you could do the calculations to determine which records are in a CI). So your batch job would not be able to get to the record while the online system is updating any record in the CI.

There is a Redbook at the IBM site called VSAM Demystified. It would be worth your while to read this Redbook.
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 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 Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top