Read filea And file b write the same records in both files?
Records in a but not in b record in b but not in a

Answers were Sorted based on User's Feedback



Read filea And file b write the same records in both files? Records in a but not in b record in b ..

Answer / ram g

we can achieve this through jcl icetool utility..

but in cobol its not that easy but possible...

consider the scenario...

file 1 file2
5 2
4 1
6 9
1 4

considering this flat seq file:
here the files are not sorted in order and need not be..
so we should take first record from file1 and match with
all the four records in file2 it should continue for end of
file and do the same for file2. can use array logic.
sorting logic in cobol wont be useful here..

Is This Answer Correct ?    2 Yes 0 No

Read filea And file b write the same records in both files? Records in a but not in b record in b ..

Answer / ravi


JOB INPUT (INFILE1 KEY (INFIL1-ID) +
INFILE2 KEY (INFIL2-ID))
IF MATCHED
PUT OUTFILE1
ELSE
IF INFILE2
OUT1-REC = INFIL1-REC
PUT OUTFILE2
ELSE
OUT1-REC = INFIL2-REC
PUT OUTFILE2

END-IF
END-IF
.

Is This Answer Correct ?    1 Yes 1 No

Read filea And file b write the same records in both files? Records in a but not in b record in b ..

Answer / raj

plz send program to this ? any one(matching logic)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


how will u pass dadta to cobol+db2 program...?

4 Answers   IBM,


01 a pic s9(5) occupies how many bytes ?

9 Answers   Wipro,


i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


what will be the output when a)pic 9(6)value 000178 is moved to pic ***,***. b)pic 9(5) value 57397 is moved to pic $$,$$9.

5 Answers  






how can i see junk values in dclgen or in hostvariable of comp ?

0 Answers   DELL,


How do u initialize an array?

2 Answers   CTS,


what will happen if i give program name and member name as different? program runs successful or w'll abend?

5 Answers   CTS,


What is R-mode and A-mode?

3 Answers   TCS,


What are ISOLATION LEVELS? Where do we need to specify them in compiling JCL (Exactly which statement and what is syntax for it)?

2 Answers   T systems,


wht do u mean by (*,intrdr) wht is * used for ?

2 Answers  


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,


Categories