It's actually much worse. There are three:
Ebcdic:
CR = x0D
NL = x15
LF = x25
Originally, CR only moved the print back to the first position of the
same line. LF only moved the print down one line without moving
sideways. NL moved both down and to the first position of the line.
When it was designed, they were using teletype machines and simple
printers. No CRTs.
Historically:
1930's had the Teletype standard: International Telegraph Alphabet No. 2
(ITA2); which had both a CR and a LF and required both at the end of a line.
1950's IBM introduces BCD and adds NL
1960's IBM introduces EBCDIC and continued using the 3 values.
1960's ATT pushes for a replacement of ITA2 which the ATA published as
ASCII in 1963. (One of their requirements was 7 bit so EBCDIC was ruled
out.)
In the ASCII world, CR and LF were the standard until the mid-1960's
when the Multics developers decided that using two characters was stupid
and they started using just LF. Unix and follow-on OSs carried on the
same tradition.
Today, it's a mess. Windows wants CRLF. Internet RFCs normally use CRLF.
Mac and Linux use just LF.
Interesting, Windows Notepad requires CRLF, but Windows Wordpad will
read and display a LF only file correctly and even change the file to
CRLF when saved.
Tony Thigpen
Ze'ev Atlas wrote on 05/28/2015 11:29 PM:
Hi allI am dealing with some C package on classic z/OS (PDS/E, no USS). When C
reads text files it inserts 0x15 in the end of the record (it goes that far as
to drop the trailing blanks and substitute them with one 0x15 for fixed length
records, but I think that there is an option to override that). 0x15 is
defined as New Line, but there is a separate character, 0x25 that is defined as
Line Feed. Does anybody know why do we need two characters that seem to do the
same thing (besides the evil desire to confuse the poor user :) Ze'ev Atlas
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN