For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2006 > When is EBCDIC not EBCDIC ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author When is EBCDIC not EBCDIC ?
Roger While

2006-05-11, 3:55 am

Answer, when it is MF's extension
ALPHABET ... IS EBCDIC.

(At least with Object Cobol, SE 2.2 and SE 4.0)
Reference ASCII<->EBCDIC conversion, Appendix B, User Guide.
(Which incidentally has 3 wrong entries, also in the online web page)

This can be demonstrated by a
SORT with COLLATING SEQUENCE ...

Feed the sort with one character records composed of all
(decimal) values from 0 to 255.

The result is, err, interesting.
What MF does is to take "printable" values plus some other values
and "move" them into the first 128 values.
The values 128 to 255 remain unchanged and get sorted to the end.
MF maintain this is working as intended.

I suppose the question is what is a collating sequence ?
And how does this relate to an alphabet ?

(OpenCOBOL allows both the MF behaviour and the full EBCDIC
sequence, dependent on environment variable)

Roger While


Michael Mattias

2006-05-11, 6:55 pm

"Roger While" <simrw@sim-basis.de> wrote in message
news:e3v108$i8l$01$1@news.t-online.com...
> Answer, when it is MF's extension
> ALPHABET ... IS EBCDIC.
>...
> I suppose the question is what is a collating sequence ?
> And how does this relate to an alphabet ?


Perhaps you are trying to SORT non-display data - or other values not
defined in the the EBCDIC character set- and that is messing up your sort?

Both ASCII and EBCDIC also have 'national' flavors, so 'language' is also a
factor.

I don't know about your specific circumtance here, but you can define an
ALPHABET in the SPECIAL-NAMES paragraph and use that alphabet-name is the
COLLATING SEQUENCE IS clause of the SORT statement. Perhaps not what you
wanted, but also perhaps a way to solve your immediate challenge.

MCM




William M. Klein

2006-05-11, 6:55 pm

Roger,
I don't know if it is still true, but MF used to have documentation that the
"with collating sequence" was ignored in some types of SORT statements.

Also, as Michael pointed out, there is no such thing as "EBCDIC" that doesn't
have national "flavors" (and/or flavours <G> )

--
Bill Klein
wmklein <at> ix.netcom.com
"Roger While" <simrw@sim-basis.de> wrote in message
news:e3v108$i8l$01$1@news.t-online.com...
> Answer, when it is MF's extension
> ALPHABET ... IS EBCDIC.
>
> (At least with Object Cobol, SE 2.2 and SE 4.0)
> Reference ASCII<->EBCDIC conversion, Appendix B, User Guide.
> (Which incidentally has 3 wrong entries, also in the online web page)
>
> This can be demonstrated by a
> SORT with COLLATING SEQUENCE ...
>
> Feed the sort with one character records composed of all
> (decimal) values from 0 to 255.
>
> The result is, err, interesting.
> What MF does is to take "printable" values plus some other values
> and "move" them into the first 128 values.
> The values 128 to 255 remain unchanged and get sorted to the end.
> MF maintain this is working as intended.
>
> I suppose the question is what is a collating sequence ?
> And how does this relate to an alphabet ?
>
> (OpenCOBOL allows both the MF behaviour and the full EBCDIC
> sequence, dependent on environment variable)
>
> Roger While
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com