Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7306

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: 10231
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Checking for availability of a data set steve-myers JCL & VSAM 1 Wed Jul 13, 2016 5:17 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us