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
 
Search all to check the availability of the key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srajanbose
Warnings : 1

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Tue Aug 23, 2011 5:23 pm    Post subject: Search all to check the availability of the key
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Aug 23, 2011 5:28 pm    Post subject: Reply to: Search all
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue Aug 23, 2011 7:36 pm    Post subject: Reply to: Search all
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

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