On 22 November 2013 00:50, Rich Long <[email protected]> wrote:

> R8 is holding the variable number of bytes (length of 1-8).  The move below 
> is working.
> Ran test data from 1-8 characters long, and it worked fine.  The other move 
> works now
> also, after adding the registers.

There's not enough context, but regardless, the MVC after BUILDCRD
will always move exactly eight bytes from wherever R7 is pointing to
wherever R6 is pointing + 19. The content of R8 has nothing to do with
it. That may well be fine, but as someone else pointed out earlier,
you need to be careful that you don't copy data from off the end of a
record. Or even data after your blank delimiter; what if the data is
"USERID=ABC Some Other Stuff" ?

Assuming CBLANK is just one byte, and SCANREC is somehow related to
where R7 points, your MVC in BUILDCRD will copy "ABC Some" to where R6
points +19. Perhaps your userid values are always eight bytes long, or
are padded with blanks to eight bytes. But in that case you probably
have to need to scan for the delimiting blank; just copy the eight
bytes.

> BUILDCRD DS    0H
>   MVC   19(R8,R6),0(R7)
>
>          CLC   3(7,R7),=C'USERID='
>          BE    EDITCOLS
>          B     EDITEXIT
> EDITCOLS LA    R7,8(R7)      Point to "D="   Not "wrong", but quirky.
>          SR    R8,R8
> EDITLOOP DS    0H
>          CLC   SCANREC(L'CBLANK),CBLANK
>          BNE   EDITACCM
>          BAL   R14,BUILDCRD
>          B     EDITEXIT
> EDITACCM LA    R8,1(R8)
>          LA    R7,1(R7)
>          CH    R8,CH8
>          BH    EDITEXIT
>          B     EDITLOOP

Tony H.

Reply via email to