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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Part2: find a specific character in a field

Status
Not open for further replies.

slade

Programmer
Jun 11, 2000
823
US
Hi BHL,

Tried to use your orig thread, but kept getting error. Sooo..

My 2c:

Code:
01  test-fld.
    05  50-byte-fld  pic  x(050).
    05  filler       pic  x(001) value x'FF'.
01  pos              pic s9(004).
 

perform with test after 
varying pos from +1 by +1
  until test-fld(pos:1) = '*'
     or pos = length of test-fld
end-perform

if test-fld(pos:1) = x'FF'
   display 'no "*" found in the field'
else
   display '"*" found at position ' pos 
           ' in the field'
end-if

The usual caveats, disclaimers and cop-outs apply.

HTH, Jack.
 
Hi,

It is nice if you compare this solution with the other ones and find out what the differences are with the CPU usage.

Perhaps you can change the field POS's picture into COMP-5 because that will be faster.

Regards,

Crox
 
Hi Crox,

Thanx for picking that up. I usually make ss COMP.
Somehow I goofed this time. Don't have a system to test on; I'm "on the beach" again. Thank you, Osama.

Regards, Jack.
 
Whatever happened to "SEARCH"? Not enough performance?

Regards,
Ronald.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top