Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


If there are two files one with 100 records and other with
101 records. we have to find out the one record that is the
odd man out . What are the steps to do it

Answers were Sorted based on User's Feedback



If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / ganapathi

I thing that is not correct.SUM FILEDS = NONE will just
ignore the duplicate records.
For acheving this situation first we need to sort both the
files based on the key.Then we need to compare both the
files based on the key.If it is matches fine else write the
key in to another file.

Is This Answer Correct ?    2 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / rajendran

Append 1 to the first file to the first position
Append 2 to the second file to the first position

Now SORT both the file records with option to sum on the
1st character.

at last the odd man record will be the one whose first
character would be "2" for all other it will be "3".

Please let me know if I went wrong somewhere.

Is This Answer Correct ?    2 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / varatharaj

using read command fetch first record from the file1 and compare that record with all records if file2 if any match occur go to second record in file1 compare like this until end of first1 if anyone with out match we can find that is odd man out in files.....

Is This Answer Correct ?    3 Yes 1 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / prasanna kumar

We can do this by external SORT in JCL
//SORTIN DD DSN=ABC.FILE1 ( that contains of 100 records)
// DD DSN=ABC.FILE2 ( that contains of 101 records)
//SORTOUT DD DSN=ABC.NEWFILE
//SYSIN DD *
SORT FIELDS =(1,4,CH,A) (jst to retreive data in sequence)
SUM FIELDS = NONE ( That eliminates the duplicates and
retrieves the data which is odd in both the files and write
in sort out file)
/*

Any other answers !!!

Is This Answer Correct ?    5 Yes 4 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / arpan

Open File 1 in 3.4.
Give command COMP 'FILE2'. It will give you the extra
record in file2.

Is This Answer Correct ?    1 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / kssb78

1. Use 3.13 option to find the different record

Is This Answer Correct ?    1 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / kamal

Hi Presannakumar,
We can't compare two files in dfsort.so u first u merge two files and using dfsort in dfsort some fields equal to none means its coming avoid the duplicates,so we can give extra xsum the particular extra record will store xsum dataset.
sync sort we can esily match.

in cobol program matcing logic program we can use and find.
read 2 file at end.
if eno = eno1
move eno to eno3
write rec
if eno > eno1
perform first-para read
write another file
if eno < eno
perform second-para read
write another file.
now the particular record presend in another file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

how to display the dataset information?

2 Answers  


How many types of sorts are there in cobol?

5 Answers   Cap Gemini,


can we declare occurs in 01 level?

2 Answers   Temenos,


How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?

4 Answers   CSC, TCS,


What is a scope terminator? Give examples.

2 Answers  


What is the maximum data length for Numeric DataType ?

3 Answers   Cap Gemini,


why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,


can anyone explain me the concept of COMP-4 PLEASE??

2 Answers  


Differentiate between structured cobol programming and object-oriented cobol programming.

0 Answers  


In which area will you utilize 88 level items in cobol?

0 Answers  


Hi................... I have records like this aaaa cccc bbbb And i want output like this bbbb cccc aaaa How can it possible ?. Note:Please make sure records are in unsorted order. somebody plzzz help me.

1 Answers  


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

0 Answers  


Categories