From: ets@wrkgrp.COM (Edward T Spire)
Subject: Re: Blanks, REXX, and portability...
Organization: The Workstation Group
Date: Tue, 1 Sep 92 16:18:42 GMT

SCHMIDT@LSTC2VM.stortek.com (Jon Schmidt) writes:
: I come from CMS and just recently began using a commercial REXX
: interpreter under UNIX.  The manual for this interpreter always
: uses words "blank" and "blanks" but never suggests that a blank
: might be anything other than a space character. 

Yes, this is a documentation problem that will be resolved.  Thanks.

:My meager UNIX
: experience had shown than there are some text files where TAB and
: SPACE characters are not "equivalent", such as makefiles.  I was
: therefore astonished to find that the UNIX REXX expression
: ('09'X='20'X) yielded a "true" result.  

This happens because the normal comparison operators trim blanks
(interpreted as isspace() true in unix) from the strings to be
compared.

: I later wrote a little
: UNIX REXX program (see below) to investigate this anomalous (to me)
: phenomenon.  I was shocked to discover that this UNIX REXX
: interpreter considered 41 of the 256 possible 8-bit codes in the
: range '00'X to 'FF'X to be blanks!  41? Where did this come from?

I ran your program on an RS/6000 and got 6 white space characters,
not 41.  Then I ran it on a older Sun and got 48!  On a newer Sun
I got 7, on an HP I got 10, and on SCO I got 44.

I used the following program to investigate further...

'uname'                /* document Unix variant in use */
count=0
do i=0 to 255
   if d2c(i)=' '
   then do
        say d2x(i) 'is white space'
        count=count+1
        end
   end
say 'total number of white space characters is' count

Here are the various outputs with some annotation...

AIX                            aix 3.2
9 IS WHITE SPACE               ascii tab
A IS WHITE SPACE                     line feed
B IS WHITE SPACE                     vertical tab
C IS WHITE SPACE                     form feed
D IS WHITE SPACE                     carraige return
20 IS WHITE SPACE                    space
total number of white space characters is 6

SunOS                          SunOS 4.1
9 IS WHITE SPACE
A IS WHITE SPACE
B IS WHITE SPACE
C IS WHITE SPACE
D IS WHITE SPACE
20 IS WHITE SPACE
83 IS WHITE SPACE              Older SunOS's are not well defined
84 IS WHITE SPACE              with respect to national language support
85 IS WHITE SPACE              and the usage of the high part of the
87 IS WHITE SPACE              ASCII character set.
88 IS WHITE SPACE
89 IS WHITE SPACE
8A IS WHITE SPACE
8C IS WHITE SPACE
8D IS WHITE SPACE
8F IS WHITE SPACE
91 IS WHITE SPACE
94 IS WHITE SPACE
96 IS WHITE SPACE
97 IS WHITE SPACE
9A IS WHITE SPACE
9F IS WHITE SPACE
A9 IS WHITE SPACE
AB IS WHITE SPACE
AC IS WHITE SPACE
AD IS WHITE SPACE
B4 IS WHITE SPACE
B7 IS WHITE SPACE
BC IS WHITE SPACE
BF IS WHITE SPACE
C3 IS WHITE SPACE
C4 IS WHITE SPACE
C5 IS WHITE SPACE
C6 IS WHITE SPACE
CE IS WHITE SPACE
D2 IS WHITE SPACE
D7 IS WHITE SPACE
D9 IS WHITE SPACE
DD IS WHITE SPACE
E3 IS WHITE SPACE
E5 IS WHITE SPACE
E6 IS WHITE SPACE
E8 IS WHITE SPACE
E9 IS WHITE SPACE
EB IS WHITE SPACE
F2 IS WHITE SPACE
F5 IS WHITE SPACE
F6 IS WHITE SPACE
total number of white space characters is 48

SunOS                          SunOS 4.2
9 IS WHITE SPACE
A IS WHITE SPACE
B IS WHITE SPACE
C IS WHITE SPACE
D IS WHITE SPACE
20 IS WHITE SPACE
F7 IS WHITE SPACE
total number of white space characters is 7

scotty            SCO 'uname' returns hostname instead of OS name (sigh)
9 IS WHITE SPACE
A IS WHITE SPACE
B IS WHITE SPACE
C IS WHITE SPACE
D IS WHITE SPACE
20 IS WHITE SPACE
84 IS WHITE SPACE             Probably the same story as SunOS
88 IS WHITE SPACE
8C IS WHITE SPACE
8F IS WHITE SPACE
90 IS WHITE SPACE
94 IS WHITE SPACE
98 IS WHITE SPACE
9B IS WHITE SPACE
9F IS WHITE SPACE
A4 IS WHITE SPACE
A7 IS WHITE SPACE
AB IS WHITE SPACE
AF IS WHITE SPACE
B0 IS WHITE SPACE
B3 IS WHITE SPACE
B7 IS WHITE SPACE
BB IS WHITE SPACE
BF IS WHITE SPACE
C3 IS WHITE SPACE
C8 IS WHITE SPACE
CB IS WHITE SPACE
CF IS WHITE SPACE
D4 IS WHITE SPACE
D7 IS WHITE SPACE
D8 IS WHITE SPACE
DB IS WHITE SPACE
DD IS WHITE SPACE
E2 IS WHITE SPACE
E5 IS WHITE SPACE
E7 IS WHITE SPACE
E9 IS WHITE SPACE
EB IS WHITE SPACE
EF IS WHITE SPACE
F1 IS WHITE SPACE
F3 IS WHITE SPACE
F7 IS WHITE SPACE
F9 IS WHITE SPACE
FB IS WHITE SPACE
total number of white space characters is 44

HP-UX
9 IS WHITE SPACE
A IS WHITE SPACE
B IS WHITE SPACE
C IS WHITE SPACE
D IS WHITE SPACE
20 IS WHITE SPACE
E5 IS WHITE SPACE              your guess is as good as mine...
EA IS WHITE SPACE
ED IS WHITE SPACE
EE IS WHITE SPACE
total number of white space characters is 10

Unix variants have not been well standardized in the past.  The newer
versions (AIX 3.2, SunOS 4.2) seem pretty well behaved with respect
to the issue at hand.

-Ed
Newsgroups: comp.lang.rexx