Re: Standard way to implement ASCII control chars

From: Tom Morrison (t.morrison_at_liant.com)
Date: 12/09/03


Date: Tue, 09 Dec 2003 19:37:23 GMT


"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: Standard way to implement ASCII control chars
    ... "In this case the alphabet is NATIVE (ASCII), and the line feed character, the ... In this case the alphabet is NATIVE, and the line> feed character, the value of which is X'0A', is the eleventh charater in the> 'ASCII alphabet.' ...
    (comp.lang.cobol)
  • 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: 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: instantaneous recall of letter order in alphabet
    ... permanent mental image of the alphabet, ... My knowledge that ^M is ASCII 13 and there are 26 letters in the ... Carriage Return character, right? ... So your toy abacus didn't have characters like sharp-S ...
    (sci.lang)
  • Re: Test for contiguous alphabet in character set
    ... > a character set with contiguous alphabets. ... > This function would test the lowercase alphabet: ... This tests contiguity of the lower-case alphabet, ... One way would be to use the position of the character ...
    (comp.lang.c)