CR - Carriage Return
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
CRexists in some EBCDIC code pages (oftenX'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 theNL(New Line) character for line breaks. - Line Ending Component: Frequently paired with
LF(Line Feed,X'0A') to formCRLF, 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.
- ASCII Value: Represented by the hexadecimal value
Use Cases
-
- FTP Text Transfers: During
TEXTmode FTP transfers between z/OS and Windows/Unix systems,CRLFsequences are automatically translated to/from z/OS's internal line ending conventions (e.g.,NLor implicit record boundaries). - Processing External Data: Reading flat files on z/OS that originated from Windows systems, where
CRLFexplicitly 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
CRLFfor line termination. - Email Processing: Handling email messages (e.g., by z/OS-based mail servers or applications), as email standards (like SMTP) mandate
CRLFas 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
CRLFfor control sequences or command termination.
- FTP Text Transfers: During
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