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

record not found


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

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Dec 16, 2008 12:10 pm
Reply with quote

hi, all

at present, i met a difficult situation.

there's a VSAM KSDS file, used both by online and batch.

during batch processing, when we try inquire a record online, get 'record not found', then we use file-aid to browse, we found that record exist in it.

so what caused that, a record can't be located online even if it is physically exists.


addition information of this file.

Code:

KEYLEN----------------22     AVGLRECL------------6549     BUFSPACE-----------17920     CISIZE--------------8192
RKP--------------------0     MAXLRECL------------6549     EXCPEXIT----------(NULL)     CI/CA-----------------90
STRIPE-COUNT-----------1                                                                                       
SHROPTNS(2,3)      SPEED     UNIQUE           NOERASE     INDEXED       NOWRITECHK     NOIMBED       NOREPLICAT
UNORDERED          REUSE     NONSPANNED      EXTENDED     EXT-ADDR   


when used by batch, the job read record from this file, update some fields, then write to another file.

Code:

amp=(amorg, 'bufnd=17', 'bufni=5')
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Dec 16, 2008 12:13 pm
Reply with quote

It is usually program logic - something silly like an offset error that causes these problems.
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Dec 16, 2008 1:42 pm
Reply with quote

hi, expat.

when the batch job completes. we close/open that file through DADS, then we can locate that record online.

can logic problem explain this. we trace this problem for almost a month, but only twice can we make this problem recurred.


by the way, this is a production problem. thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 16, 2008 2:16 pm
Reply with quote

who reads ONLY
who updates
what are the share options

why such a poor approach when zillions of IBM publcation advice
against VSAM sharing between batch and cics
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 16, 2008 6:04 pm
Reply with quote

Oh, lord. You do not want to do this. Basically what happens is the records written by the batch job aren't going to be seen by the CICS application without flushing the buffers and forcing a re-read of the file -- such as closing and opening them via DADS. Your CICS application may do things such as attempt to read the VSAM file based on indexes that were updated by the batch job (due to a CI or CA split, for example). There's a simple term for this situation: corrupted file. It is quite easy for the file to be so corrupted that delete / define becomes the only way to recover it.

If you really have to do it this way, you need a batch enqueue / dequeue routine and use the CICS ENQ and DEQ commands to ensure the file is processed correctly. You probably are going to need to review the SHAREOPTIONS and carefully think about which values you need. This will have performance implications for both batch and online, but it's a trade-off: if you gotta do it this way, you're gonna take a performance hit.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 16, 2008 6:09 pm
Reply with quote

and even with proper enqueuing the cics recovery will be messed up
unless the vsam is closed,
the journals are switched and properly archived ( for forward recovery )
and and and .....
even a simple restart might fail, IIRC for update requests the restart recovery program would use RBA processing, not keyed access
and with batch inserts there could be RBA shifts
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Dec 16, 2008 8:28 pm
Reply with quote

Hi, Robert

actually, the batch program is just to use that file as input, the output is another file(during batch processing, that file is read-only for both CICS application and batch), which cause the index be updated? and i think CA/CI splits yet will not occurred.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 16, 2008 8:33 pm
Reply with quote

if a file is read only for everybody and there is evidence that the record is there
then for "a not record found" there are only two alternative ...

(1) a program error
(2) a PBCAK (*)

(*) PBCAK Problem Between Chair And Keyboard
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top