beautypg.com

Example, Implementation considerations, Example implementation considerations – HP Integrity NonStop H-Series User Manual

Page 97

background image

Example

For this example assume the following:

is an ASCII-coded file

abc

is an entry-sequenced file with a file code of 1001

ebig

is a key-sequenced file with a file code of 1002

kbig

is a relative file with a file code of 1003

rbig

The program:

STRU F
put abc ebig using the attributes for ebig file,
overwrite its content with abc.
ebig is still an entry-sequenced file.
put abc kbig overwrites kbig with abc.
put abc rbig overwrites rbig with abc.
put ebig ebig1,e,1002,,,,60 creates ebig1 with attributes specified.
get kbig kbig1,k,1002,,,,500,20 creates kbig1 with attributes specified.
append ebig rbig append records from an entry-sequenced
file to a relative file.
put kbig abig create an ascii file, abig, with information
from a key-sequenced file, kbig.
get rbig rbig1,r,1003,,,,60 creates a relative file, rbig1.

STRU R
put ebig ebig2 creates an entry-sequenced file with a
default record length of 4000.
append ebig ebig2 append record in ebig to the end of ebig2
get kbig ebig3 creates an entry-sequenced file, ebig3, using
the data from kbig.
put ebig kbig2,k,e,1001,,,,60 creates a key-sequenced file, kbig2.
append rbig rbig2,r,1003,,,,112 creates a relative file, rbig2.
get ebig ebig4,e,1001,1000,,,60 creates an entry-sequenced file, ebig4.

Implementation Considerations

With some sites being naturally file-oriented and others naturally record-oriented there can be
problems when a file with one structure is sent to a host oriented to the other structure. For example,
sending an HP NonStop structured file to a Unix machine, which treats all files as a byte stream.

The stru command provides transparent data transfers. By default, file-structure is assumed for data
transfers. Use the stru command with the r option specified to transfer record-structure files containing
embedded character sequences.

In the HP NonStop implementation, a encountered in a file is treated as a record delimiter
for a structured-file transfer. If a appears within a record, it is misinterpreted as marking
an end-of-record. Using the stru command with the r option specified (stru r) provides
transparent data transfer.

Transferring files using stru r (record-structure mode) incurs extra processing. Therefore, the throughput can be
significantly lower (roughly 50%).

No other vendor has implemented record-structure file transfer. Therefore, its usefulness is limited to the NonStop host
that has implemented this feature.

If you accidentally turn on record-structure mode, and the other side hasn’t implemented this feature, your original data
will be mixed with Telnet control code.

Due to limitations of the underlying library routines we are using, records in a key-sequenced file
must be in sorted order before you use the put or send commands.

Transferring Structured Files

97

This manual is related to the following products: