I have files that contains both duplicates files(occur more
than twice) and non-duplicate files.The file is already
sorted by a key.I want to determine those records that are
duplicate and will be move to a duplicate file and non-
duplicate files to be move to a valid file.thank you.help
please

Answers were Sorted based on User's Feedback



I have files that contains both duplicates files(occur more than twice) and non-duplicate files.Th..

Answer / tamilselvan

Instead of cobol, try this with SORT in JCl.it will be
easier.
SORT FIELDS=copy
SUM FIELDS=NONE,XSUM


define a file with DD card SORTXSUM after SORTWK file in
the proc step.
You can capture the duplicate rows in the sortxsum file and
non dupliucates in the SORTOUT file.

Is This Answer Correct ?    7 Yes 1 No

I have files that contains both duplicates files(occur more than twice) and non-duplicate files.Th..

Answer / sowjanya

using jcl,
//ddname1 <- input file
//ddname2 <- outfile1(no duplicates)
//xsum <- outfile2 (duplicate)
//sysin dd *
sort fields=copy
sumfields =none,xsum
/*

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More COBOL Interview Questions

In INITIALIZE what is Repalcing Word will do

1 Answers   CTS,


Write the syntax of a two dimensional array?

8 Answers   Honeywell, Xansa,


How to read a record from bottom of a file which is indexed by 'A'.

4 Answers   Oracle,


A table has two indexes defined. Which one will be used by the SEARCH?

0 Answers  


What is difference between comp & comp-4?

6 Answers  


I try to use some column names in my cobol progorm but these column not in db2 table ..when do i get error ..while bind time or runtime?

2 Answers  


How to open and see copy book ?

3 Answers  


In COBOL, what is the different between index and subscript?

0 Answers   TryTechnicals Pvt Ltd,


which is better either static call or dynamic call? and why?

5 Answers   HCL,


What is length is cobol?

0 Answers  


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,


How do you get the data to code the BMS macro?

0 Answers   IBM,


Categories