to search in two tables



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

to search in two tables

Postby mainframe1 » Thu Mar 11, 2010 9:48 am

i have two tables,
one is having 200 records and other i have 300 records. i need to get matching records and do computations an write in 2nd table for corresponding value

a 10
b 10
c 20
d 30

a 10
f 20
b 30
h 40

abcd, occours 200 times, afgh, occurs 300times , need to read its table for matching enties in 2nd table say a,b sum it up and write it to 1st table.
can u help
regards
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time

Re: to search in two tables

Postby dick scherrer » Thu Mar 11, 2010 10:02 am

Hello,

With the very little posted we can be very little assistance. . .

Suggest you lose the alphabet-soup description and show a more representative sample of your requirement. In addition to posting better "input" you need to post what you actually want as output when the sample data is processed.

need to read its table for matching enties in 2nd table say a,b sum it up and write it to 1st table.
There is no proper explanation of the "rules" for summing.

Once this information is posted, you also need to post how you intend to solve the requirement before you write all of the code. If the process is not well understood, it is impossible to write code.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: to search in two tables

Postby mainframe1 » Thu Mar 11, 2010 11:39 am

hi ,
the fields

001 abc 1 10 20
001 bsc 1 20 30
001 aaa 1 10 20
001 bbb 1 10 20
001 ccc 1 10 20
.
.up to 300
table1

001 abc 9 10 20----- number up to 255
001 bca 9 30 20
001 bbb 9 40 20
001 ccc 9 50 20
.
. up to 200
table2

i need to browse the two tables fromatching rows for 1 and 9 and then do manipulation say 10+ 10, 20-30
mainframe1
 
Posts: 35
Joined: Wed Oct 08, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post