Re: Class Test for Valid Characters

From: Colin Campbell (cmcampb_at_adelphia.net)
Date: 06/29/04


Date: Tue, 29 Jun 2004 14:13:06 -0700

Are you working in an ASCII or EBCDIC environment?

If it is EBCDIC, the upper case alphabetics are not all contiguous in
terms of their hex values, so you would have to test for
"A" THRU "I",
"J" THRU "R", and
"S" THRU "Z".

Hex 'E0' is higher than "R" and lower than "S".

It may be better (and less platform dependent) to test for
ALPHABETIC-UPPER, and if that is true, test for and eliminate the SPACE
character, or if it is false, test for NUMERIC.

Wes Jester wrote:

>I have set up a class test as
>SPECIAL-NAMES.
>
>CLASS ValidChar IS 'A' THRU 'Z',
> '0' THRU '9'.
>
>I need to verify that the input contains only these characters. I used a
>full field name test and determined that errors were getting thru.
>
>IF InMaster IS ValidChar
> CONTINUE
>ELSE
> DISPLAY 'Error in Field'
>END-IF
>
>However, errors were showing up in the field.
>
>When I test each character, I find that the backslash "\", X'E0', is considered
>valid. HIGH_VALUEs, X 'FF' is also considered valid.
>
>Does anyone know why these characters are considered valid cahracter within
>the class test?
>
>
>
>Wes
>
>



Relevant Pages

  • Re: Class Test for Valid Characters
    ... :>Are you working in an ASCII or EBCDIC environment? ... the upper case alphabetics are not all contiguous in ... :>>I have set up a class test as ... :>>I need to verify that the input contains only these characters. ...
    (comp.lang.cobol)
  • Re: Pascal - C (2)
    ... your Pascal original only validates the ... intended) would validate all the uppercase characters from 'A' to 'Z' ... only "target characterset" characters required to be in ascending, ... additional characters /between/ various alphabetics. ...
    (comp.lang.c)