You can specify a different record structure for the output file, and if the record length of the output file is greater than the record length of the input file, you can specify a padding character. You need to specify the record structure of the input file only where the file does not have a header. If you do not specify the record structure of the output file it will have the same structure as the input file. If you only specify one record structure, it is taken to be the record structure of the output file, unless the input file has no header, in which case it is taken to be the record structure of the input file.
If you convert to and from Btrieve format indexed files using the /s and /t options, you might need to supply the /r option, even where you are not changing the record structure. This is because some indexed file features are implemented differently by Btrieve. An example is that Btrieve does not store the maximum record length. Therefore, on conversion from a COBOL format file to a Btrieve file and back again, certain record length and recording mode information can be lost. This makes the file unreadable to a COBOL program using the original file description. Using the /r option, you can specify the record length and recording mode information on the command line to retain the correct record definitions during conversion. You can determine the correct options from the COBOL format file using the /n option.
Parameters
frecord-length | specifies a fixed-length record format with records of record-length |
vmin-record-length-max-record-length | specifies a variable-length format where min-record-length is the minimum record length and max-record-length is the maximum record length. Separate the lengths with a hyphen |
ppad-character|[ddecimal-value] | specifies the padding character where the output record length is greater than the input record length. The default is spaces for line sequential files and NULLs for all other file organizations. d indicates that the padding character is supplied as a decimal value in the range 0 through 255, indicating the ANSI character to be used |
Examples
/r:f100
(where the input file has no header) specifies that the input file has a fixed record length of 100 bytes and that the output file will have the same fixed record length.
/r:v100-200
(where the input file has a header) specifies that the output file will have a variable record length with a minimum record length of 100 bytes and a maximum record length of 200 bytes.
/r:f20,f30pZ
specifies that the input file has a fixed record length of 20 bytes, and that the output file will have a fixed record length of 30 bytes with Z used as a padding character.
/r:f40pd49
specifies that the output file will have a fixed record length of 40 bytes with the character "I" used as a padding character.