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

write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

0 Answers  


i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk values pls say how to do ths reply fast

4 Answers   L&T,


WHAT IS SOC3?HOW IT CAN BE RESOLVED?

1 Answers  


what is the use of filler in cobol programing?

4 Answers   MAT,


i want a program using by if, evaluate , string, unstring, perform, occurs?

1 Answers  






What is the maximum length of a field you can define using COMP-3?

4 Answers   Complex System, Infosys,


Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???

5 Answers   IBM,


How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.

1 Answers   Syntel,


comp-3 field occupy?

5 Answers  


Difference between array and sub-script ?

0 Answers   HCL,


Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,


what modification we need to do in jcl if we use sort in cobol? I mean whether we need to include tempary file used for sorting in assign statement?

3 Answers   TCS,


Categories