Thanks @Jonathan.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Jonathan Scott
Sent: Wednesday, March 14, 2018 9:56 AM
To: [email protected]
Subject: Re: Two string instruction questions

Ref:  Your note of 14 March 2018, 08:51:22 -0700
 
Charles Mills wrote:
> 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?
 
I'm not aware of any such instruction.  You can use SRST to find a single
character, and that can be used as part of a search algorithm.
 
> 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?
 
CUSE is very useful for creating an efficient representation of the
differences between two versions of a record, for example to create a log
record showing which bytes changed. It finds the end of a block of changed
data, ignoring unchanged sequences which are too small to be worth
representing as a separate section. To skip to the end of the unchanged
data, CLCL or CLCLE can be used.
 
Jonathan Scott
HLASM, IBM Hursley, UK

Reply via email to