I know an easy way to do it in a z/OS UNIX file, using sed. The only
restriction is that it won't work if the file has an embedded x'15'
(z/OS UNIX new line). On a z/OS UNIX shell prompt (such as TSO OMVS,
or ssh or telnet). If the value at the start of the record is not a
printable character, you must determine its OCTAL value (not HEX).
Suppose the value is x'27', which is octal 047

cp -B "//'ZOS.DSN'" zos.dsn #copy to UNIX file in binary mode
sed 's/\047/\n\047/g' <zos.dsn >zos.dsn.txt #insert new line before
beginning of record value
cp zos.dsn.txt "//ZOS.DSN.VB.TXT" #copy to dataset in TEXT mode

If the character is printable, just use it in the sed:

sed 's/*/\n*/g' <zos.dsn >zos.dsn.txt

Now, if that special value occurs _only_ as the first character,
you're golden. Otherwise you'll need to edit the new data set and
perhaps do some TF commands to flow multiple records into a single
record. I do this by inserting a blank record after the last of the
continuations, do the TF on the first record of the set, then delete
the inserted blank record.

Oh, I'd preallocate the "zos.dsn.vb.txt" files with the proper DCB
attributes before doing the above.

On Tue, Jan 15, 2013 at 11:04 AM, Charles Mills <[email protected]> wrote:
> I've got a dataset that has been mangled through some misguided efforts such
> that original record boundaries have been lost. It used to be RECFM=V and
> now it is RECFM=F
>
> As luck would have it, every original record begins with the same hex value.
> Can anyone suggest a simple tool -- z/OS, USS, or Windows -- that would
> reformat the records breaking on every occurrence of a particular byte
> value?
>
> Yes, I know I will get some false positives, but it's test data, not
> production data, and I can probably live with that. It would be an
> improvement on what I have -- that's for sure.
>
> I believe I have access to ICETOOL but I am embarrassed to admit I have
> never used it. I glanced at the doc just now but did not see anything that
> looked relevant -- but perhaps I missed something.
>
> Thanks all!
>
> Charles
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN



-- 
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