In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
Answer Posted / animesh
It can be done using internal array table within the cobol program. first we will Move Record file in an aray with same Lrecl as the file1 and having 80 occurence.
Then again for file 2 we will populate another internal array table with 1000 occurence.
perform varying w-v-idx1 from w-k-1 by w-k-1 until
w-v-idx1> 80
perform varying w-v-idx2 from w-k-1 by w-k-1 until
w-v-idx2>1000
If w-v-file1(w-v-idx1) = w-v-file2(idx2)
Set some w-s-count = y
Add +1 to w-s-count
move -w-v-file1(w-v-idx1) to w-v-file3
write file 3 from w-v-file
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
I have a File that has duplicate records. I need only those records that occur more than thrice.?
Can we change the password using ALTER? anyone tried and changed?
How you can characterize tables in cobol?
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
Have you used comp and comp-3 in your project? And how?
Write a program to explain size error.
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
Can a Search can be done on a table with or without Index?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What is the LINKAGE SECTION used in COBOL?
how can i see junk values in dclgen or in hostvariable of comp ?
Write the code implementing the perform … varying.
What type of SDLC u followed? Why?
What are the different rules for performing sort operation?