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

i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

984


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

668


What is cobol?

736


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?

5355


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

699






What is rmode(any) ?

676


How do u write test cases?

1631


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1103


explain sorting techniques in cobol program?

682


Mention the guidelines to write a structured cobol program?

603


What are the different rules to perform a Search?

611


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

632


For rewrite, why is it mandatory that file needs to be opened?

616


Which mode is used to operate the sequential file?

654


what is the use of outrecord?

1765