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
WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375
What are steplib and joblib? What for they are used?
What is the purpose of dd * statement in jcl?
Explain the function of dd disp parameter?
Explain in DD statement what is the use of DCB parameter?
What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?
Is it possible to define dd statements as you want?
what are the types of abends that occur on job failure? And explain the possible causes of these
how do you code a null statement?
Why block size is multiple of lrecl in jcl?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
What is concatenating?
i want to store 20 digits . how will u do it in cobol ?
What does a disposition of (new,catlg,keep) for a dsn mean?
Can we call instream to catalog and catalog to instream?