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
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 |
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 |
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 |
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 |
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 |
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 |
what modification we need to do in jcl if we use sort in cobol? I mean whether we need to include tempary file used for sorting in assign statement?
How do u find the programs calling the given module, without having doing 3.13 on loadlib/source library?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How do you define a sort file in JCL that runs the COBOL program?
01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i need to get the miuns sign in the result?
In a file if a column account number conatain value 0001234.. how can we move the value to another variable without zero. value may contain any type such as 00123405. we need the value 1234 or 12305. how can we do that in cobol. Please help.
How to retrive the 9th records out of ten records using the cobol program ?
how to crack cts interview apps? NOVEMBER 21 2010
What is EIBCALEN? Why it is used?
What is the maximum data length for Numeric DataType ?
What is the use of LINKAGE SECTION?
Give some advantages of REDEFINES clause?