Transferring files into AIX and Windows

ACIF needs to know two things about a file to print it:

  • The length of each print record
  • The kind of carriage control used
As simple as these requirements are, they cause the most difficulty for people who are printing with ACIF in an AIX or Windows environment.

ACIF processes print records. A record is a sequence of contiguous characters, typically representing a printed line or a MO:DCA-P structured field. Each record has a defined boundary or length. Some files contain information in each record that describes the record's length; these files are called variable-length files. Other files require an external definition of length; these files are called fixed-length files.

  • Variable-length files
    • Variable-length files can use a length prefix to indicate the length of the record in the file. The length prefix is a 2-byte binary number that prefixes each record. The record length is all the bytes in the record other than the 2-byte length prefix, but including X'5A' carriage control characters at the start of structured fields. Use the FILEFORMAT=RECORD parameter to identify files with length prefixes.
    • Variable-length files can use a separator or delimiter (also called a newline character) 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. For AIX or Windows, the default delimiter is X'0A'. If the file uses EBCDIC encoding, the default delimiter is X'25'. Use the FILEFORMAT=STREAM parameter to designate files that use delimiters to indicate record boundaries. NEWLINE can be used with FILEFORMAT=STREAM to specify the delimiter if the default is not correct. See FILEFORMAT for the NEWLINE values you can specify.
    • If NEWLINE is not specified, ACIF reads the first 6 bytes to decide whether a file is encoded in ASCII or EBCDIC characters. If only characters below X'7F' are found, ACIF assumes that the file is ASCII and looks for the ASCII newline character (X'0A') to delimit the end of a record. Otherwise, ACIF looks for the EBCDIC newline character (X'25') to delimit the end of a record. Because ACIF might decide incorrectly whether the file is ASCII or EBCDIC (for example, if the data contains non-English-language characters), the best way to ensure that your data is processed correctly is to explicitly specify NEWLINE with the FILEFORMAT parameter. See FILEFORMAT for the NEWLINE values you can specify.
  • Fixed-length files
    • Fixed-length files contain records that are all the same length. No other separators or prefixes or self-identifying information exists that indicates the record length. You must know the record length and use the FILEFORMAT=RECORD,n parameter, where n represents the length of each record.

For variable- and fixed-length files that use length prefixes, MO:DCA-P structured fields are treated as a special case. All such structured fields are self-identifying and contain their own length. They need not contain a length prefix to be correctly interpreted, but are processed correctly if there is a length prefix.

Note: CRLF characters found in mixed mode at the end of MO:DCA-P structured fields are treated as a separate record, which causes extra blank lines to be printed.