Doesn't TR just do a one-for-one translation of bytes? I.e. I don't
think you can use it to "insert", as your OOPS indicated. Your "tr"
translates all \??? to \025 and all \025 to \???. I don't think this
is what is desired.

We could merge your answer with mine similar to:

cp -B "//'ZOS.DSN'" /dev/fd/1 |\
sed 's/\???/\n\???/g' |\
cp /dev/fd/0 "//'NEW.ZOS.DSN'"

Oh, one thing I notice. My solution will insert a blank line at the
front of the file if the first byte is the \???. And it wouldn't put
in a trailing new line, but I think the "cp" won't mind that.

Of course, I wouldn't even use "cp", I'd use "fromdsn" and "todsn"
from Dovetail Technologies' Data Set Pipes.

On Tue, Jan 15, 2013 at 11:44 AM, Paul Gilmartin <[email protected]> wrote:
<snip>
> Having RTFM a little more, I'd go with (untested):
>
>     cp -B "//'BAD.DATA.SET'" /dev/fd/1 |
>         tr '\???\025' '\025\???' |
>         cp /dev/fd/0 "//'BETTER.DATA.SET'"
>
> o where \??? is the _octal_ value of your delimiter character (\025 is octal 
> newline).
> o Preallocate your BETTER.DATA.SET.
>
> Oops.  This loses your delimiter character.  Put it back with sed.
>
> -- gil




-- 
Maranatha! <><
John McKown

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

Reply via email to