Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us