Writing to text files

z/OS® XL C/C++ treats the control characters as follows when you are writing to a non-ASA text file:
\a
Alarm. Placed directly into the file; z/OS XL C/C++ does not interpret it.
\b
Backspace. Placed directly into the file; z/OS XL C/C++ does not interpret it.
\f
Form feed. Placed directly into the file; z/OS XL C/C++ does not interpret it.
\n
New-line. Defines a record boundary; z/OS XL C/C++ does not place it in the file.
\r
Carriage return. Defines a record boundary; z/OS XL C/C++ does not place it in the file. Treated like a new-line character.
\t
Horizontal tab character. Placed directly into the file; z/OS XL C/C++ does not interpret it.
\v
Vertical tab character. Placed directly into the file; z/OS XL C/C++ does not interpret it.
\x0E
DBCS shift-out character. Indicates the beginning of a DBCS string, if MB_CUR_MAX > 1. Placed into the file.
\x0F
DBCS shift-in character. Indicates the end of a DBCS string, if MB_CUR_MAX > 1. Placed into the file. See z/OS XL C Support for the double-byte character set for more information about MB_CUR_MAX.

The way z/OS XL C/C++ treats text files depends on whether they are in fixed, variable, or undefined format, and whether they use ASA.

As with ASA files in other environments, the first character of each record is reserved for the ASA control character that represents a new-line, a carriage return, or a form feed. See Using ASA text files for more information.

Table 1. C control to ASA characters
C Control Character Sequence ASA Character Description
\n ' ' skip one line
\n\n '0' skip two lines
\n\n\n '-' skip three lines
\f '1' new page
\r '+' overstrike