have in 100 records in a file i want to move only matched
records to one output_file1 and nonmathed records are
moved to another output_file2 ... any one can provide
logic code

Answer Posted / abhay

WE CAN SOLVE THIS PROBLEM THROUGH 2 METHODS..
1) THROUGH JCL:
By using ICEMAN utility, it cab be done as below:
//S1 EXEC PGM=ICEMAN
//DD1 DD DSN=.....
//DD2 DD DSN=....
.
.
//SYSIN DD *
SELECT FROM INDD(DD1) TO OUTDD(DD2) ON (1, 4 CH, A) ALLDUPS
SELECT FROM INDD(DD1) TO OUTDD(DD2) ON (1, 4 CH, A) NONDUPS
*/
//
2) THROUGH COBOL PROGRAM:
AS BELOW

1)FIRST SORT 2 FILES ON ANY KEY
2)READ 2 FILES FOR MATCHING KEYS.IF KEY OF 2 FILES MATCHED,
THEN PUT RECORDS INTO FILE3 ELSE MOVE IT INTO FILE4
3)REPEAT THE PROCESS UNTIL END-OF-FILE1 AND END-OF-FILE2.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the configuration section of a cobol program with examples of syntax.

659


Which division and paragraphs are mandatory for a COBOL program?

709


What is the usage of comp fields in cobol?

660


Have you used comp and comp-3 in your project? And how?

2008


What kind of error is trapped by on size error option?

740






What are declaratives and what are their uses in cobol?

714


What is perform what is varying?

709


What are the rules of the move verb?

707


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5379


) what is the difference between AID and HANDLE AID?

1637


What are the access modes of START statement?

719


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1523


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

685


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

748


) How do u handle errors in BMS macro?

1429