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 happens if parmparameter passes zero bytes to the program
What are various search techniques in cobol? Explain.
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
how can i see junk values in dclgen or in hostvariable of comp ?
What are the different open modes available in cobol?
how to convert the recors form vsam file to db2 table tru file aid
Write down the divisions of cobol program?
What is a SSRANGE and NOSSRANGE?
Name some of the examples of COBOl 11?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Write the code implementing the perform … varying.
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
what is difference between cobol and cobol/400
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?