Beware: a "locate / abc /" won't find the abc word at the start or front of records. Rob's solution is very nice indeed.
2007/10/4, Harding, Mike <[EMAIL PROTECTED]>: > > Try changing or translating all white-space characters to blanks, then > look for / abc /. > Hint: see predselect. > > -----Original Message----- > From: CMSTSO Pipelines Discussion List > [mailto:[EMAIL PROTECTED] On Behalf Of Alan Ackerman > Sent: Wednesday, October 03, 2007 3:24 PM > To: [email protected] > Subject: Locate Words > > Is there a Pipelines idiom to locate only words, instead of strings. > In my case the words can be delimited by special characters, not > just blanks (they are, in fact, variable names in program code). > > For example, I'd like to say > > 'locateword /abc/' > > and locate abc=5 > i(abc) > 1+abc-f > but not abcd=5 > i(xabc) > etc. > > In my case, underscore is a letter (part of a word) not a special > character. > > I inherited a mass of code, in fact a whole subsystem, that scans all > the > files on all minidisks and directories on a large system for requested > strings. When run against code, looking for variable names, if gets far > too > many hits. I cannot afford to really redesign the system, I'd just like > to > replace > > locate /abc/ > > with > > locateword /abc/ > > A REXX stage would probably slow the system down too much, unless it was > just a CALLPIPE. > > Alan Ackerman > Alan (dot) Ackerman (at) Bank of America (dot) com > -- Kris Buelens, IBM Belgium, VM customer support
