View previous topic :: View next topic
|
Author |
Message |
awadh2241
New User
Joined: 09 Jan 2006 Posts: 2
|
|
|
|
Hi,
Can any one send me the link of sample code of array handling with search all in cobol or req code as below details:
My requirement is -
Input File1:
1
2
1
4
1
5
3
4
Input Master File(is sorted):
2
3
Mismatched value with master file and count of the value of file1.
Out put Required result:
1 Count Records - 3
4 Count Records - 2
5 Count Records - 1 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Why do you believe this is related to "search all" in any way?
If you want to do this using COBOL, sort both files by "the key" and then match/merge the data accumulating the counts. . . |
|
Back to top |
|
|
awadh2241
New User
Joined: 09 Jan 2006 Posts: 2
|
|
|
|
actualy this is a part of d requirement. we need to add some default value if value doesnt found in master file. thats why need to resolve this thr cobol only. I post here the req in simple way to know d logic where both files contain mutiple fields. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
actualy this is a part of d requirement. |
What is the requirement? Surely NOT "search all".
At the top of the COBOL part of the forum is a working sample of cobol code to match/merge 2 files that are already sorted in key sequenct. You can download this and modify for your specifics. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
If this is an exercise on search
if not too many records ,you could
Code: |
define 2 ws-tables : Master & not-matched
store the master file in a ws-table
do search all for each record in input
when not found
(sequential) search in not-matched
store it with count 1 when not found
or add 1 when found |
I wouldn't recommend this approach in a real production environment |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
This is a class homework assignment, isn't it? |
|
Back to top |
|
|
|