You didn't simplify it; you changed the behavior. You're checking for non-blank 
while Lionel was checking for plus. Column 72 suggests assembler, but the 
concatenation rules are more complicated than what the OP wrote. I have no idea 
what the OP wanted, but neither version is correct for assembler, CLIST or REXX.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Saturday, July 11, 2020 11:52 AM
To: [email protected]
Subject: Re: Concatenating lines

On Sat, 11 Jul 2020 08:27:54 -0500, Lionel B Dyck wrote:

>This is a very quick and somewhat dirty example:
>
>/* rexx */
> 'alloc f(in) ds(lionel.doc(concinp)) shr reuse'
> 'execio * diskr in (finis stem in.'
> 'free  f(in)'
> do i = 1 to in.0
>   data = ''
>   if substr(in.i,72,1) /= '+'
>   then data = in.i
>   else do while substr(in.i,72,1) = '+'
>     data = data''substr(in.i,1,71)
>     i = i + 1
>     data = data''substr(in.i,1,71)
>     i = i + 1
>     if substr(in.i,72,1) /= '+' then i = i - 1
>   end
>   say data
> end
>
>Now have fun with this and I'm sure you can improve upon it for your purposes 
>- a generalized input prompt or allocation and same for output.
>
/* Not making a non-continued line a special case,
   I'd simplify the loop to: */

 signal on novalue  /* Always!  */
 data = ''
 do i = 1 to in.0
   parse value in.i with l 72 c 73 .
   data = data''l
   if c = ' ' then do
     say data
     data = ''
   end
 end i

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to