"Quay, Jonathan (IHG)" wrote:
> positioned, so I need to rewind. Is it as simple as piping a literal
> TAPE REW, fanning out, taking one, cmsing and then connecting the fanout
> back to a tape stage to write the label, repeating the process for the
> FSF 1 before the data? Does the pipeline synchronously wait for the cms
> command to complete, and if not, how do you synchronize?
Yes, the CMS stage is synchronous, i.e., it doesn't release the input
record until it's done with it. Of course, there are two other timing
controls you need to worry about: Reading the whole file before you
rewind, and rewinding and labeling the tape before you start writing the
file.
If something in your process doesn't already buffer the whole file,
you'll need a BUFFER stage to make sure you read it all before doing
anything else. Then, to control the timing of the tape commands, instead
of LITERAL you can use FANOUT|TAKE|SPECS to generate them synchronously
with the first record. And you might want to abort the write if you get
any errors from the TAPE commands, which you can do by feeding any
nonzero return codes to GATE. Something like this:
(end /) tape ... | buffer | f: fanout | take 1
| specs "TAPE REW" 1 write "TAPE WVOL1" 1 ...
| not command | not verify '0' | g: gate
/ f: | g: | tape
(You get to fill in the ellipses, of course.)
¬R