I've been a mostly silent lurker on this list for some time.   While I use
Pipes a lot in my VM/CMS execs I don't consider myself to be a 'master
plumber'.  Instead I mostly use it for file I/O where you might have seen
EXECIO used.  I use much more than just the "<" & ">" read and write
routines but much of what is discussed on this list is over my head.

Occasionally though I wade into Pipe's deeper waters where I find, or
create, problems that I don't understand.  Today I want to share such a
problem with you and ask for your help.

I have an exec that gets a print file created in a z/OS EC machine.  (This
is test case output, I support an automated testing tool for DFSMS
development.)  To make this file more useful I added a top line to the
output with details about where and when it ran along with release
information.  This helps the testers a lot when they have multiple outputs
to analyze that are similar but from different environments.

To minimize the I/O I didn't want to read the file to disk and add my line
because some of them are quite large, hundreds of thousands of lines.
Instead I used the following Pipe to read the PRT file in the spool, add my
line, and create a new spool file.

/* read rdr file data, add a top line, create a new PRT file */
'PIPE READER FILE' spool_id ,
  '|preface literal ' space(line) ,
  '|spec / / 1 2-* n' ,
  '|asatomc' ,
  '|printmc'

If I remember correctly, the Specs stage is replacing a carriage control
character that wasn't visible to avoid a visible one showing in the new
file.

This routine worked (I thought) for the last 18 months but now I find that
it also seems to insert the occasional blank line in the output.  These
output files are automatically verified while they are in the spool, by
running an Xedit macro against them from a modified PEEK based tool.  This
is important because it is what the file looks like in PEEK that determines
how it will verify as success or failure.  I suspect the blank lines are
occurring because I am replacing a carriage control character with a blank
and while the original carriage control character and its line weren't
visible from PEEK, the replacement blank is now visible as a new blank line
in the modified file.

If I haven't confused the issue too much can anyone offer a solution so I
can add that top line to a PRT file while keeping the resulting file
visibly identical (from PEEK) to the original spool file?

Thanks,
--
Russ Brooks  --  SVM Support  (aka: RLB at STLVM5)

Astronomy Picture of the Day: http://antwrp.gsfc.nasa.gov/apod/
TANSTAAFL

Reply via email to