I remember looking at CUSE and being very disappointed that it was not more of 
general substring search instruction.

The following quote from POPS began my angst :

" Comparison is done left-to-right, byte by byte. The
compare operation ends when an inequality is found, the
'end-of-string' character is found in either string, or
a CPU-determined number of bytes (at least 256) is
reached. If the 'end-of-string' character is found
simultaneously in both operand strings, the strings are
considered to be equal and condition code zero is set.  "

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of retired mainframer
Sent: Wednesday, March 14, 2018 4:52 PM
To: [email protected]
Subject: Re: Two string instruction questions

According to John Ehrman's "Assembler Language Programming for IBM System zT 
Servers Version 2.00," the CUSE instruction searches only for matches at the 
same offset.  In the case you describe, it would not find a match unless the 
second string was "xxxxis" so that the word you are looking for is at offset
4 in both strings.

> -----Original Message-----
> From: IBM Mainframe Assembler List <[email protected]>
> On Behalf Of Charles Mills
> Sent: Wednesday, March 14, 2018 8:51 AM
> To: [email protected]
> Subject: Two string instruction questions
>
> 1.       Is there a machine instruction that will find one string within
> another? That given "Now is the time" and "is" would find the "is" and
> return a pointer to it? A machine instruction analog of Rexx POS?
>
> 2.       Searching the PoOp for such an instruction led me to CUSE. It
does
> not seem that CUSE could be used for this - is that correct? If I am
reading
> CUSE correctly, then given "Now is the time", "All is well" and 2 or 3
would
> return the position of "is". Is my reading correct? What would that be
good
> for? What would be a reasonable real-world use?
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ 
Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: 
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - 
http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of 
Rocket Software, Inc. All unauthorized use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify Rocket 
Software immediately and destroy all copies of this communication. Thank you.

Reply via email to