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
Is there any command to check wether the ps file is in sorted order?
What is the motivation behind coding class parameter in job statement?
How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
Must tape dataset definitions include vol=ser specifications?
What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?
Name the statement which can be used to send data to another mvs jes3 node?
I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.
Is automatic restart possible in jcl? If yes, how?
Brief description of inline procedure of jcl.
What does it mean by Restart and Checkpoint in JCL ? How are checkpoints being taken and what is their usage ? How to use Checkpoint macro on a JOBSTEP ?
What dd statement is used to supply the name of a dataset?
Explain in DD statement what is the use of DCB parameter?
What do you understand by jcl?
what is “Cond= even” and “Cond=only”?