I use INDEX for this type search in UniBasic. It returns the starting character position of the string if found otherwise 0
CASE INDEX(OP.SPEC,'MIL',1) # 0 * ADD IT TO A RECORD RECORD<-1>=ID CASE INDEX(OP.SPEC,'Spec',1) # 0 * ETC -----Original Message----- From: Brutzman, Bill [mailto:[email protected]] 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/
