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
 

 

Array handling with search all in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Array handling with search all in cobol
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

Site Director


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

PostPosted: Tue Sep 21, 2010 8:56 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Sep 22, 2010 9:48 am    Post subject:
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    Post subject:
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: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Wed Sep 22, 2010 4:47 pm    Post subject:
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    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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 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 COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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