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 |
How do you define a variable of comp-1 and comp-2?
What are different data types in cobol?
How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.
what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?
In my table having 3000 Records. How can I delete the 500th row? (we don't know what is data inside the table)
Write a program to concert an Indexed file into Sequential file?
What was removed from COBOL in the COBOL II implementation?
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
wht is structured cobol pgm and non structred cobol pgm ?
What is the difference between index and subscript?
In the JCL, how do you define the files referred to in a subroutine ?
Which division and paragraphs are mandatory for a COBOL program?