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

Why would you use find and get rather than to obtain?

0 Answers  


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,


what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.

10 Answers   Mascon,


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

0 Answers  






In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  


Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.

2 Answers  


SIGN TRAILING SEPARATE field occupy ?

3 Answers  


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

1 Answers   Syntel,


whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?

9 Answers  


what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


What will happen if we try to create GDG (+2) generaton instead of (+1) generation?

1 Answers  


Categories