Operation |
|
The effect of CCTL or NOCCTL depends upon whether or not the file equations or disk labels of the files you are copying specify carriage control. If you do not use either function, FCOPY treats carriage control characters as shown in table 5-2.
Table 5-2 Copying Files without Using CCTL or NOCCTL
CCTL specified in the file equation or disk label for | Default Effect |
---|
fromfile | tofile | |
NO | NO | The entire record of the fromfile is copied to the tofile. |
NO | YES | The entire record of the fromfile is copied to the tofile; a single spacing character is supplied. |
YES | NO | The entire record of the fromfile, including the carriage control character, is copied into the tofile as data. |
YES | YES | The entire record of the fromfile is copied into the tofile. The carriage control character for the fromfile becomes the carriage control character for the tofile. |
Table 5-3 shows the effect of using the CCTL function with files that have CCTL or NOCCTL specified. When an equation or disk file label for the tofile specifies NOCCTL (no carriage control) and an FCOPY command specifies CCTL, the NOCCTL specification in the file equation or disk label overrides the FCOPY command.
|
| |
|
| NOTE:
Asterisks (***) show where a file equation or disk label overrides the
FCOPY command in tables 5-3 and 5-4.
|
|
| |
|
Table 5-3 Copying Files Using CCTL
CCTL specified in the file equation or disk label for | Effect |
---|
fromfile | tofile | |
NO | NO*** | The entire record of the fromfile is copied to the tofile. No carriage control characters are supplied. |
NO | YES | The entire record of the fromfile is copied to the tofile; the first character of the fromfile record is interpreted as a carriage control character, not as data. |
YES | NO*** | The entire record of the fromfile, including the carriage control character, is copied as data. |
YES | YES | The entire record of the fromfile is copied into the tofile. The carriage control character for the fromfile becomes the carriage control character for the tofile. |
Table 5-4 shows the effect of using NOCCTL.
Table 5-4 Copying Files Using NOCCTL
CCTL specified in the file equation or disk label for | Effect |
---|
fromfile | tofile | |
NO | NO | The entire record of the fromfile is copied to the tofile. No carriage control character is supplied. |
NO | YES*** | The entire record of the fromfile is copied to the tofile. A single spacing carriage control character is supplied for each record of the tofile. |
YES | NO | The entire record of the fromfile, including the carriage control character, is copied as data. |
YES | YES*** | The entire record of the fromfile, including the carriage control character of the fromfile, is copied into the tofile. A single spacing carriage control character is supplied for each tofile record. |
Examples |
|
ALPHA is a disk file, and its label specifies the CCTL
option. BETA is a disk file created without CCTL.
The command below copies each record from BETA to ALPHA,
interpreting the first data character in each
record in BETA as the carriage control character:
In the next example, the command copies each record from
ALPHA to GAMMA,
a new file, using the carriage control
character in each record in ALPHA as the carriage control
character in each record in GAMMA. File GAMMA is
created with the CCTL attribute, as follows:
>FROM=ALPHA;TO=GAMMA;NEW;CCTL
|
As we have seen above, ALPHA is a disk file that has CCTL
specified in its label, and BETA is a disk file without CCTL. In the following
example, the FCOPY command copies each record from ALPHA to
BETA, including the carriage control character, as data.
>FROM=ALPHA;TO=BETA;NOCCTL
|