On 10/2/07, Paul Gilmartin <[EMAIL PROTECTED]> wrote:

> Also, I'm struggling to understand (apprentice plumber) how to archive a
> labelled tape in which two consecutive tape marks do not necessarily denote
> EOT.

Not "archive" as in putting it on the shelf (or in the bin, as I am
sometimes told to) ?

It really does make a difference what you want to do with it later. If
the idea is just to be able to reconstruct a tape similar to the
original, then you can get away with not knowing what's on the tape.
But when you want to keep the files somewhere to use them instead of
using the tape, then you need to understand the layout of the data and
build a catalog to find the files.

On a labeled tape, double tape marks don't mark EOT, but special tape
labels do (supporting also multi-volume tapes). You're not supposed to
try read beyond EOT or EOV. When you retrieve data from a labeled
tape, you will need to inspect the tape labels. Something like this
(without the book handy)

 signal on error
 do fseq = 1
    'PIPE  tape | stem hdr.'
    'PIPE  tape | > FILE'right(fseq,4,0) 'TAPEFILE A'
    'PIPE  tape | stem eof. | strnfind /EOF/ | take | count lines | var done'
    if done then leave
 end

Obviously you need to do something with the two REXX stems here. What
you might do is use the DCB information from the HDR.2 and deblock the
data. And the DSN in HDR.1 can be used to identify the data better.
This reveals the dataset names and blocking used on the tape, so that
allows you to reconstruct the original data in a form that can be used
by your programs.

Another popular approach is to simply copy the tape labels along with
the data as if they were files, and make end of tape by errors on
reading it (but you may see more data than you need to). The easiest
is to have sequence numbers for the files (where a missing number
indicates two tape marks with nothing in between).

 do fseq = 1
    'PIPE tape | > FILE'right(i,4,0) 'TAPEFILE A'
    if rc <> 0 then leave
  end

To rebuild you write each file with the "tape wtm" stage, and the
missing file will be just a "tape wtm"  - Since the last file is not
empty (but EOV) you have a criterion to end the program.

Rob
--
Rob van der Heij
Velocity Software, Inc
http://velocitysoftware.com/

Reply via email to