Re: Standard way to implement ASCII control chars
From: Tom Morrison (t.morrison_at_liant.com)
Date: 12/09/03
- Next message: Chuck Stevens: "Re: Internal Sorts"
- Previous message: Howard Brazee: "Re: Abt cobol data types"
- In reply to: Karl Kiesel: "Re: Standard way to implement ASCII control chars"
- Next in thread: William M. Klein: "Re: Standard way to implement ASCII control chars"
- Reply: William M. Klein: "Re: Standard way to implement ASCII control chars"
- Reply: Douglas Gallant: "Re: Standard way to implement ASCII control chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Chuck Stevens: "Re: Internal Sorts"
- Previous message: Howard Brazee: "Re: Abt cobol data types"
- In reply to: Karl Kiesel: "Re: Standard way to implement ASCII control chars"
- Next in thread: William M. Klein: "Re: Standard way to implement ASCII control chars"
- Reply: William M. Klein: "Re: Standard way to implement ASCII control chars"
- Reply: Douglas Gallant: "Re: Standard way to implement ASCII control chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|