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

Search all to check the availability of the key


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajanbose

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Tue Aug 23, 2011 5:23 pm
Reply with quote

Hi,

I have an requirement as below.

The program reads an first input file and take the Key value from the record after that i need to verify in the second file whether the key is present or not.

I think this can be done using search and search all.But i heard its not optimised way. so anyone suggest some other way to acheive this requirement.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 23, 2011 5:28 pm
Reply with quote

Hi Rajan,

Quote:
The program reads an first input file and take the Key value from the record after that i need to verify in the second file whether the key is present or not.


Can you give us this in a paragraph, with punctuation, so we don't have to guess at what you are saying (I've lost count of how many different meanings this sentence might have depending on punctuation). Then we can get to the second bit.

Often, what you "hear" is pretty worthless because if nothing else there is no context to it, so no way of knowing if it applies to your situation.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue Aug 23, 2011 7:29 pm
Reply with quote

Several questions come immediately to mind:
1) Is the first (input) file a sequential file, or a VSAM KSDS file?
1a) If a sequential file, is it sorted on the "key value"? If not, why not?
1b) If a KSDS, is the "key value" leftmost in the file's key or alternate index?
2) Is the second (match) file a sequential file, or a VSAM KSDS file?
2a) If a sequential file, is it sorted on the "key value"? If not, why not?
2b) If a KSDS, is the "key value" leftmost in the file's key or alternate index?
3) Does this 'matching process' HAVE to be done in a COBOL program? (hint: it could be easily accomplished using a SORT product).
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Aug 23, 2011 7:36 pm
Reply with quote

it looks like the classic transactions/master files relation...

the transaction file should be sorted on the master key...

then there are two choices ( depending on the transaction record count vs. master record count )

1) if the ratio is greater than about 30 % most probably the two file match approach might be faster

2) in a stationary state ...
read the transaction file and keep reading if the key is the same,
when the key changes issue a keyed read for the master,

that' s all
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top