NetBase for MPE Reference Guide

NetBase Utilities
13-21
Limitations
In order to copy files as fast as it does, NBCOPY does not really pay too much attention to records. In
most copy operations, NBCOPY copies blocks of records, not records. As a result, NBCOPY does not
really work as well when copying to or from undefined record length files. In other words, if you
simply want to dump a file to your terminal, or key in data to a disk file, use FCOPY instead.
Variable files can be copied, but not to a fixed length file. You will get unusual results if you do.
Appending one file to another does not work unless the last block of the TO file is completely full. If
it is not, you will find a few blank or zero records filling the (formerly) last block of the TO file.
FCOPY is also a must if you want to copy a file with small records to one with larger records. With
FCOPY, records are copied one by one, so each record is filled with blanks or binary zeroes when it
is written to the new file. In the same situation, NBCOPY would reblock as many small records as
necessary to make one larger record. For example, if you copy from a file with 100 word records to
a file with 150 word records, it would take three input records, concatenate them, and write out two
output records. It would look something like this:
: FILE NEWFILE;REC=150,,F,ASCII
> FROM=OLDFILE;TO=NEWFILE;REBLOCK
Record
1
Record
2
Record
3
100 100 100
would become:
Record 1 Record 2
150 150
Use FCOPY, unless you want this result when increasing record sizes. NBCOPY cannot copy NM
KSAM files.