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
Differentiate between structured cobol programming and object-oriented cobol programming.
Explain how you can characterize tables in cobol?
How you can read the file from bottom?
Explain the configuration section of a cobol program with examples of syntax.
i want a program using by if, evaluate , string, unstring, perform, occurs?
How arrays can be defined in COBOL?
What is cobol?
What rules are followed by the search verb.
What is perform what is varying?
How to remove 2 duplicate records and copy only one using job control language?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What are declaratives and what are their uses in cobol?
What do you understand by psb and acb?
What is the use of intialize verb?
what happens if parmparameter passes zero bytes to the program