On 1/14/2023 3:12 AM, Bruce Axtens wrote:
> IDENTIFICATION DIVISION.
> PROGRAM-ID. ISOGRAM.
> ENVIRONMENT DIVISION.
> CONFIGURATION SECTION.
> SPECIAL-NAMES.
> ALPHABET LOWERCASE IS "abcdefghijklmnopqrstuvwxyz".
> ALPHABET UPPERCASE IS "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
CLASS LOWERCASE IS "abcdefghijklmnopqrstuvwxyz"
CLASS UPPERCASE IS "ABCDEFGHIJKLMNOPQRSTUVWXYX".
Note: Only ONE period to terminate all SPECIAL-NAMES.
To use INSPECT the way you want, you need to define CLASSes of characters.
ALPHABET means something entirely different, and uses standard names
like EBCDIC, ASCII, or NATIVE.
Rick Smith's example using COBOL intrinsic functions will also work.
Kind regards,
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 WS-PHRASE PIC X(60).
> PROCEDURE DIVISION.
> ISOGRAM.
> MOVE "my dog has fleas" TO WS-PHRASE.
> INSPECT WS-PHRASE CONVERTING LOWERCASE to UPPERCASE.
> display "ws-phrase " WS-PHRASE.
> GOBACK.
>
> JDoodle.com gives me
>
> ws-phrase _
>
>
>
> whereas tutorialspoint and onecompiler give me
>
> main.cobc: 14: error: 'LOWERCASE' is not a field
> main.cobc: 14: error: 'UPPERCASE' is not a field
>
> Is it just the way it is that I have to have my upper and lowercase case alphabets declared in working-storage for the inspect converting to work?
>
> Bruce
--
https://www.arnoldtrembley.com/