IDENTIFICATION DIVISION.
PROGRAM-ID. ISOGRAM.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
ALPHABET LOWERCASE IS "abcdefghijklmnopqrstuvwxyz".
ALPHABET UPPERCASE IS "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
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
IDENTIFICATION DIVISION.
PROGRAM-ID. ISOGRAM.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
ALPHABET LOWERCASE IS "abcdefghijklmnopqrstuvwxyz".
ALPHABET UPPERCASE IS "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 151:22:46 |
Calls: | 10,383 |
Files: | 14,054 |
Messages: | 6,417,800 |