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: 1278
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: 7931
Location: Bellevue, IA

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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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