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

Array handling with search all in cobol


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

New User


Joined: 09 Jan 2006
Posts: 2

PostPosted: Tue Sep 21, 2010 8:50 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 21, 2010 8:56 pm
Reply with quote

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
View user's profile Send private message
awadh2241

New User


Joined: 09 Jan 2006
Posts: 2

PostPosted: Wed Sep 22, 2010 9:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 22, 2010 9:48 am
Reply with quote

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Sep 22, 2010 3:08 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Sep 22, 2010 4:47 pm
Reply with quote

This is a class homework assignment, isn't it?
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top