Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL and Wild cards

Status
Not open for further replies.

Simonataston

IS-IT--Management
Jul 24, 2003
2
0
0
US
General enquiry : I would like to add wildcard functionality to a program but have been told this is not possible and would cost a lot to get developed. A basic question i know.
 
please be more specific as to what you are trying to accomplish.
 
Sorry a bit general- The application is in the throws of being developed. Users would like to search customer records by customer name using a wild card. This is mainly due to data quality.

Example

looking for smith
*ith

 
Simon -

That is indeed a tough requirement to fulfill.

If you're doing name lookup and you're dealing with primarily English names, the various soundex algorithms are quite useful for locating names that "sound" alike but are spelled differently (e.g. Smith and Smyth). The soundex algorithm generally reduces each name to a small string (4-6 characters). Using this code as a key, one can then retrieve all records with names similar to the one being searched for.

We developed a hospital patient search facility using this technique (with modifications for un-named babies, e.g. Baby Smith, sex, first initial, and birthdate/age). We've been using it quite successfully for many years to search a growing database of about 1,000,000 names.

Regards.

Glenn
 
I also implemented a Soundex search once. It worked quite well, as I recall.
 
I have a program that is similar.
Im using widows 2000 and running RM-Cobol for windows.
What I do is CALL SYSTEM USING ITEMNAME.
ITEMNAME looks like this.
01 ITEMNAME.
05 FILLER PIC X(80) VALUE
"DIR FOLDER\FOLDER\*.TXT /S/O/B > DIR.LOG'
This creates a file named DIR.LOG with the files names of all the .txt files in those folders and sub folders.
I then open this file and read it into a table and inspect
my way thu the table to search out particular file paterns.
inspect table-entry(sub) tallying tally for ALL 'ITH'. If tally > 0 then I move that table-entry(sub) to a file name
specifier and open that file. This might work for you.
Enjoy Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top