File1 has 100 records and file2 has 200 records i want to
copy 50 records which r in both file into file3
Answer Posted / mani
First need to sort both files
READ FILE1
READ FILE2
PERFORM UNTIL EOF = 'Y'
IF FILE1-ID > FILE2-ID THEN
READ FILE2 AT END MOVE 'Y' TO EOF
ELSE IF FILE1-ID < FILE2-ID
READ FILE1 AT END MOVE 'Y' TO EOF
ELSE IF FILE1-ID = FILE2-ID
WRITE FILE3
READ FILE1 AT END MOVE 'Y' TO EOF
READ FILE2 AT END MOVE 'Y' TO EOF
END-PERFORM
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How would you understand error(execution phase)?
How to pass data to a program that is coded in an exec statement?
What parameters can be used to limit the number of records written to a sysout dataset?
How gdg are concatenated?
what EXEC statement is and what is the syntax of EXEC statement used in JCL?
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
What do you understand by the term notcat 2 – gs?
Can we call instream to catalog and catalog to instream?
What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?
In job processing, what happens in conversion stage?
define cond parameter in jcl?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
What do you know about jcl?
how you can access an uncataloged dataset in a JCL?
how to do automated restart when a job abends?