Variable-length files

Variable-length files can use a length prefix, which means they contain a prefix that identifies the length of the record in the file. Each record contains a two-byte field that gives the length of the record. If the record contains a length, that length must be a prefix for each record and it must be a 16-bit binary number that includes the length of the 2-byte length prefix. Use the fileformat=record keyword and value to identify files with length prefixes.

Variable-length files may use a separator or delimiter to indicate the end of a record, instead of using a length prefix. All of the bytes up to, but not including, the delimiter are considered part of the record. The default delimiter is X'0A'. If the file uses EBCDIC encoding, the default newline character is X'25'. Use the fileformat=stream keyword and value to designate files that use newlines to indicate record boundaries.

You can also specify the explicit newline characters that InfoPrint should use to delimit records. This is specified as a subparameter of the fileformat keyword. For example, fileformat=stream, (newline=CRLF,ASCII). For details, see the description of the line2afp command in the InfoPrint Manager: Reference.

If you do not explicitly specify the newline characters, InfoPrint reads the first six bytes and tests for all ASCII characters (code points from X'00' to X'7F') to determine if a file is encoded in ASCII or EBCDIC. If no non-ASCII characters are found, line-data transform program assumes the file uses the ASCII newline character, X'0A'. Otherwise, the transform assumes the file uses the EBCDIC newline character, X'25'. Because an input file can misguide the line-data transform, you should specify newline on the file format keyword to make sure that InfoPrint will use the correct characters.