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
in ways data can be passed to a COBOL program from JCL?
What is one line to pass PARM from JCL to COBOL?
Is their any set of rules for dd? Explain.
What are steplib and joblib?
what is the purpose of coding class parameter in job statement?
write a jcl to execute a job by 7:00 am on jan 20,1986?
How to run cobol program using jcl?
What is the function of job statement in jcl?
how JCL works?
In sms datasets, what is the function of the dd mgmtclas keyword?
what is the compile process of cobol program expalin with code
A dd statement consists of 4 fields. Name them?
What is the significance of addrspc parameter in the exec statement?
How does the jcl specify the job to os?
Explain how can the submitting users racf authority be overridden in a job stream?