![]() |
- FC |File Conversion
FC [file1, file2] [, ?] [, reclim] [, const] [, opt] [, LEN=length]
The input file (file1) is converted to a second file, (file2), in any format.
file1 Name of the input file, or a comma if the output record should consist of a specified pad character.
file2 Name of the output file.
The output file's attributes can be set in the FC mask (see below), or predefined with a /FILE command with LINK=OUTFCB.
Entering the command FC without any parameters, or entering the file names followed by a question mark (FC [file1], file2, ?), will display the FC mask.
The FILE command to determine the output file's attributes can, for example, look as follows: /FILE file2,LINK=OUTFCB,FCBTYPE=ISAM,RECFORM=F,RECSIZE=4000 ,KEYPOS=20, KEYLEN=12, BLKSIZE=(STD,2),SPACE=(30,30).
Instead of the name of an output file, OUTFCB can also be given in the FC command. In this case the file name is determined from the OUTFCB link name.
? A question mark can be entered after the name of the output file, which will cause the FC mask to be displayed. The file attributes, as well as all the following parameters, can be entered.
reclim maximum number of records to be converted from file1 to file2.
Standard: reclim=number of input records, or reclim=1, if no input file is specified.
const C'string' | X'string'
Specify a character with which the output record should be padded, in case the input records are longer than the output records. Multiple characters can also be specified.
Standard: C'_'.
opt IK | EK | NA
IK Insert Keys: ISAM keys for the output file records are generated by CFS. These keys can also be generated for SAM files by specifying the IK option. In this case, the output record will contain an 8 digit sequence after the record length field.
Standard: no IK, i.e. the ISAM key is contained within the file to be converted. If this ISAM key is not in ascending sequence, then the option NA(Non Ascending keys; see below) must be specified.
EK Eliminate Keys: The ISAM keys present in the input file will be stripped from the records in the output file. If the input file is not an ISAM file, then the EK option has no effect.
Standard: no EK, i.e. when converting ISAM input files, the keys are not stripped out.
NA Non Ascending Keys: When converting to an ISAM file, the input file contains the data for the ISAM keys. These, however, are not in ascending order, and so CFS has to use the ISAM macro STORE, instead of PUT. The NA option results in, amongst other things, the input records being sorted.
Standard: no NA. A non-ascending key area in the input file will cause a DVS error.
LEN=length Number of bytes in the output record to be created. Any ISAM key and the record length field does not count as part of the data. The LEN option causes Recform-V records to be written to the output file with a length of 4 + length (SAM), or 4 + keylen + length (ISAM).
Standard: Output files with RECFORM=V will contain records with the same length as the input file.
Notes:
The utility program PAMCONV will be invoked for executables and PLAM libraries when BLKCTRL=NO is specified.
The parameter RECSIZE=8 must always be given if an output file in RECFORM=U format is required. (Scratch pad register 8 is used by the program for the length of the output record).
If the name of the input file is left blank in the FC mask, then an output file with the specified format consisting of records containing the pad character will be created. The record length is determined by the Recsize value, or by the LEN option for Recform=V formats. The number of records to be written to the output file is specified in the Record-Limit field.
The FC command can also be used to convert SAM/ISAM files to PAM format, and vice versa. The following cases can be distinguished:
SAM/ISAM --> PAM
1) Input file: BLKSIZE = (STD,1)
The input file (SAM/ISAM) is read block-wise, and written as a PAM file. The data content is unchanged.
2) Input file: BLKSIZE > (STD,1)
It is assumed that the first 16 bytes of the input records of the SAM/ISAM file (Recform=V) contains the data for the PAM keys. Following that, 2048 bytes of data are expected for a full PAM block.
PAM --> SAM/ISAM
1) Output file: BLKSIZE = (STD,1)
The input file is transfered block-wise to the output file. The data content is unchanged. Only the FCBTYPE of the file is converted from PAM to SAM/ISAM.
2) Output file: BLKSIZE > (STD,1)
The PAM key is put into the first 16 bytes of each output record. The 2048 data bytes of the PAM block is appended to this.