Modernization Hub

CR - Carriage Return

Enhanced Definition

Carriage Return (`CR`) is a control character, primarily defined in ASCII as `X'0D'`, that historically signaled a print head or cursor to return to the beginning of the current line without advancing to the next line. In the mainframe z/OS context, it is most relevant when interacting with non-mainframe systems, particularly as part of the `CRLF` (Carriage Return Line Feed) sequence used as a line ending in Windows and many internet protocols.

Key Characteristics

    • ASCII Value: Represented by the hexadecimal value X'0D' (decimal 13) in the ASCII character set.
    • EBCDIC Mapping: While CR exists in some EBCDIC code pages (often X'0D'), its functional meaning as a line terminator is not native to z/OS's internal text processing, which typically relies on record boundaries or the NL (New Line) character for line breaks.
    • Line Ending Component: Frequently paired with LF (Line Feed, X'0A') to form CRLF, which serves as a standard line terminator in environments like Windows, DOS, and various network protocols (e.g., HTTP, SMTP).
    • Non-Printable: It is a control character and does not have a visible glyph when displayed, though its presence can affect text formatting.
    • Cross-Platform Significance: Its presence is critical when exchanging text files between z/OS (EBCDIC-based) and ASCII-based systems, requiring careful translation or handling.

Use Cases

    • FTP Text Transfers: During TEXT mode FTP transfers between z/OS and Windows/Unix systems, CRLF sequences are automatically translated to/from z/OS's internal line ending conventions (e.g., NL or implicit record boundaries).
    • Processing External Data: Reading flat files on z/OS that originated from Windows systems, where CRLF explicitly marks the end of each logical record or line.
    • Web Server Log Analysis: When z/OS applications process log files or data streams generated by web servers or other internet services, which commonly use CRLF for line termination.
    • Email Processing: Handling email messages (e.g., by z/OS-based mail servers or applications), as email standards (like SMTP) mandate CRLF as the line ending for message headers and body.
    • Telnet/TN3270 Protocols: While 3270 terminals are field-oriented, underlying network protocols or line-mode Telnet sessions might utilize CRLF for control sequences or command termination.

Related Concepts

CR is intrinsically linked to LF (Line Feed), as the CRLF pair is the most common line ending sequence it participates in. It plays a crucial role in ASCII/EBCDIC conversion, as its presence and functional meaning must be correctly translated when text files move between these character sets, often requiring specific mapping rules or utility functions. Unlike CRLF in ASCII systems, z/OS record formats (like FB or VB datasets) typically define record boundaries by length or a Record Descriptor Word (RDW), rather than explicit CR or LF characters within the data stream. FTP TEXT mode is specifically designed to handle the translation of CRLF and other line

Related Vendors

IBM

646 products

Applied Software

7 products

Related Categories

Security

144 products

REXX

23 products

Operating System

154 products

Encryption

41 products