Page 1 of 1

Weird error using DISPLAY

Posted: Wed Jun 30, 2021 12:30 am
by mrfrisky330
Hello!

I am struggling with some bizarre errors when using DISPLAY particularly if I try this:

DISPLAY "SHOW FIELD ON SCREEN? (Y/N) (X = EXIT): " WITH NO ADVANCING.

The OpenCOBOL Compiler produces weird errors:
./SchemaCreator.cobc:75: error: 'X' cannot be used here
./SchemaCreator.cobc:75: error: 'Y' cannot be used here
./SchemaCreator.cobc:75: error: syntax error, unexpected NO
./SchemaCreator.cobc:75: error: invalid symbol '!' - skipping word

invalid symbol ! - there isn't a "!" in the DISPLAY statement..?.

Before this there are lots of these type of DISPLAY commands:
DISPLAY " (X = EXIT): " WITH NO ADVANCING.

Which produces no errors! I thought (perhaps assumed?) that COBOL's DISPLAY command was similar to BASIC's PRINT and didn't have the "foibles" of C#/C++...

Any ideas why it doesn't like my DISPLAY statement?

Re: Weird error using DISPLAY

Posted: Thu Jul 01, 2021 11:27 pm
by Anuj Dhawan
An educated guess - is the code in correct "area" for DISPLAY? May be show the actual code, a screen shot?

Re: Weird error using DISPLAY

Posted: Tue Jul 20, 2021 7:59 pm
by Taran Bhatia
Do we use OpenCOBOL in production environments?