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
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 |
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 |
9(2).99 how many bytes take? Why . consider as a byte?
how will u pass dadta to cobol+db2 program...?
01 a pic s9(5) occupies how many bytes ?
i want to store 20 digits . h will u do it in cobol ?
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.
how can i see junk values in dclgen or in hostvariable of comp ?
How do u initialize an array?
what will happen if i give program name and member name as different? program runs successful or w'll abend?
What is R-mode and A-mode?
What are ISOLATION LEVELS? Where do we need to specify them in compiling JCL (Exactly which statement and what is syntax for it)?
wht do u mean by (*,intrdr) wht is * used for ?
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.