Re: Class Test for Valid Characters
From: Colin Campbell (cmcampb_at_adelphia.net)
Date: 06/29/04
- Next message: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Previous message: Chuck Stevens: "Re: COBOL ABBREVIATED CONDITION"
- In reply to: Wes Jester: "Class Test for Valid Characters"
- Next in thread: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Reply: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
>
>
- Next message: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Previous message: Chuck Stevens: "Re: COBOL ABBREVIATED CONDITION"
- In reply to: Wes Jester: "Class Test for Valid Characters"
- Next in thread: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Reply: Binyamin Dissen: "Re: Class Test for Valid Characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|