SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
C-121
COPY Command
{ UNLOADOUT | NO UNLOADOUT }
(for copying to magnetic tapes only) specifies whether the tape is unloaded when
rewinding occurs. The default is UNLOADOUT (the tape is unloaded when it is
rewound).
VAROUT
(for copying to Enscribe files only) writes variable-length, blocked records.
Each Enscribe variable-length record is preceded by a one-word indicator
containing the record length in bytes. The indicator is always aligned on a word
boundary, although records might contain an odd number of bytes. The indicator
and the write count are equal although the record might have been truncated.
Truncation occurs if the record is longer than out-record-length or
out-block-length minus two. (Two extra bytes are required for the indicator.)
Records cannot span blocks. If the next record with its indicator does not fit into the
current block, VAROUT terminates the current block and begins a new block.
VAROUT terminates a block by writing a 1-word block terminator of -1 (%177777)
to indicate that no more valid records are in the block, then padding the remainder
of the physical block. VAROUT cannot write the terminator when the previous
record ends on a block boundary or when out-block-length is odd and only
one byte remains in the block.
Empty or zero-length records are supported.
The PAD and FOLD options are not allowed with VAROUT.
This sample block has a BLOCKOUT length of %30. The three records “FRESNO”,
“MUNICIPAL”, and “BANK” illustrate the action of VAROUT:
___________
| %000006 | <- Length indicator for record 1
| F R | <-
| E S | | Record 1
| N O | <-
| %000011 | <- Length indicator for record 2
| M U | <-
| N I | |
| C I | | Record 2
| P A | |
| L | <-
| %177777 | <- Block terminator (end of block)
| p p | <- Padding
|___________|
For the third record, BANK and its record-length indicator require six bytes,
beginning on a word boundary. Because only four bytes remain in the sample
block, VAROUT terminates the block and writes the BANK record to the next block.