Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
This appears to be the same topic as your other topic. You have still not answered the questions asked there. That topic has been locked, so you can continue here.
As i mentioned, there you need a much more clear definition of the requirement before you look at how to code a solution - regardless of whether you try with only db2/sql or actually use come probram code.
Suppose If we do it through cobol program means reading all the keywords into array and using INSPECT or SEARCH identifying the keword in Description table.
Not necessarily. Again, the rules need to be understood before development begins.
For some other similar (i believe) requirements, i parsed out all of the "real" words in what you call the desccription and placed them in a qsam file that had each "word", the length of that word, and the id where it was located. Small words (less than 3 characters) were discarded as well as things like "'s" and "(s)" and other non-key components (like money and dates). What i used for rules may not be the same as you would need.
These words were technical components of some chemical manufacturing specifications and the goal was to identify all of the formula that used certain components. When the process was complete, there was a new table that contained all of the words used in all of the specifications and which specifications the word(s) were used in. Every word that was retained, was kept with the direct info to the database entries that contained it.
To meet a requirement that we "track" certain groups of materials (equivalenmt to your keywords), I also created a sequential file of the keywords and their length.
By sorting both files by the "word", i was able to match them with very little code and very little system resource usage. There were no big arrays or INSPECT/SEARCH processing.
As i asked in the other topic, how will you use the counts once they have been determined?