What we have done when we are going to be looking for the same thing over and over is to create a dictionary that identifies the data and nulls it if it doesn't have it. Then you create an INDEX on the dictionary. Extremely fast.
Like ED DICT IM CHKPART 1 V 2 IF INDEX(OP.SPEC,"MIL",1) THEN OP.SEC ELSE IF UPCASE(INDEX(OP.SPEC,"SPEC",1)) THEN OP.SEC ELSE IF INDEX(OP.SEC,"-14",1) THEN OP.SEC ELSE "" 3 4 PARTS 5 20L 6 S IF OP.SEC has spaces in it you could also use FIELD instead of INDEX. Nicholas M Gettino | Director of Development | EnRoute Emergency Systems, an Infor company | office: 813-207-6998 | fax: 678-393-5389 [email protected] | www.enroute911.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Brutzman, Bill Sent: Friday, March 13, 2009 10:40 AM To: [email protected] Subject: [U2] - UniBasic String Search I need to examine fields for perhaps one thousand part.numbers looking for tech specs that contain character strings like "MIL" "Spec" "SPEC" "-14" etc While I can do this with commands like... execute 'SELECT IM WITH OP.SPEC LIKE "...-14..." ', this technique is awkward since I have a few dozen strings to look for... I have the IBM tech manual describing the MATCH operator and the MATCHFIELD function. Is there a handy UniBasic method to handle this or should I write a little program to do this myself? Fixes would be appreciated. --Bill ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
