Re: Standard way to implement ASCII control chars

From: William M. Klein (wmklein_at_nospam.netcom.com)
Date: 12/09/03


Date: Tue, 09 Dec 2003 21:23:31 GMT

Re:

"In this case the alphabet is NATIVE (ASCII), and the line feed character, the
value of which is X'0A', is the eleventh character in the 'ASCII alphabet.'

It should be noted that X"0A" is the 11th "character" in ANY computer character
set that supports all bit combinations from X"00" thru X"0A" - regardless of
what those bits MEAN. This is why using "11" in either the CHAR intrinsic
function or the SYMBOLIC CHARACTER phrase of the Special-Names paragraph will
allow a programmer to produce an X"0A" - even if that bit-pattern does NOT mean
"line-feed" on that computer. This is why either solution (where available)
will allow a program to create/use an ASCII "line feed" character - even in a
NON-ASCII environment.

-- 
Bill Klein
 wmklein <at> ix.netcom.com
"Tom Morrison" <t.morrison@liant.com> wrote in message
news:TvpBb.173$rf2.72364133@newssvr11.news.prodigy.com...
> "Karl Kiesel" <Karl.Kiesel@fujitsu-siemens.com> wrote in message
> news:3FD5ECE9.2F08B657@fujitsu-siemens.com...
> > we would have proposed as a portable solution the definition of a
> > 'constant' in special-names paragraph as
> >   SYMBOLIC CHARACTERS  line-feed  IS  11
> > (without an IN alphabet clause).
> > Anything wrong with this solution, since nobody else did offer it ??
>
> Karl,
>
> It is the correct solution, though it is normally overlooked.  To expand a
> bit:
>
> ENVIRONMENT DIVISION.
> CONFIGURATION SECTION.
> SPECIAL-NAMES.
>     SYMBOLIC line-feed IS 11.
> ...
> ...
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01  LF-CHARACTER PIC X VALUE line-feed.
> ...
>
> The SYMBOLIC mechanism defines a symbolic (aka figurative) constant which
> may be used in the manner of other predefined figurative constants (such as
> SPACE).
>
> I will attempt to answer preemptively a follow-on question, "Why 11?"  The
> integer that is specified is the ordinal position of the character within
> the alphabet.  In this case the alphabet is NATIVE (ASCII), and the line
> feed character, the value of which is X'0A', is the eleventh charater in the
> 'ASCII alphabet.'
>
> Tom Morrison
> Liant Software Corporation
>
>


Relevant Pages

  • Re: Better term than alphabet?
    ... of the alphabet (ASCII, "phonetic") or substitutes for it, as you say. ... of up letters and only letters. ... If you want to be direct and use a single term, it must be "character set". ...
    (alt.usage.english)
  • Re: Standard way to implement ASCII control chars
    ... "Karl Kiesel" wrote in message ... > (without an IN alphabet clause). ... In this case the alphabet is NATIVE (ASCII), ... feed character, the value of which is X'0A', is the eleventh charater in the ...
    (comp.lang.cobol)
  • Re: Help removing end of file character from csv files
    ... is the line feed character in ASCII. ... When I open the CSV files in Excel, the EOF ...
    (microsoft.public.scripting.vbscript)
  • Re: Better term than alphabet?
    ... include things like Braille, ASL, semaphores, Morse code, ASCII, ... I thought of "character sets", but that doesn't quite seem to get ... The defining characteristic of an alphabet is that it's made ... the things we would otherwise call "patterns of dots", in the Braille ...
    (alt.usage.english)
  • Re: Standard way to implement ASCII control chars
    ... Agree that it would be an oft overlooked solution. ... In this case the alphabet is NATIVE (ASCII), ... > feed character, the value of which is X'0A', is the eleventh charater in ...
    (comp.lang.cobol)