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
What are the access modes of START statement?
Name some of the examples of COBOl 11?
Write some characteristics of cobol as means of business language.
How arrays can be defined in COBOL?
Name the sections present in data division.
What is amode(31)
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
what is the difference between COBOL2 AND COBOL390?
Can you please let me know the centre name of INS certification in Kolkata.
how can i see junk values in dclgen or in hostvariable of comp ?
what is difference between cobol and cobol/400
What is the difference between Global and External Variables?
What are all the divisions of a COBOL program?
What rules are followed by the search verb.