Weird error using DISPLAY

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
mrfrisky330
New Member
Posts: 1
Joined: Wed Jun 30, 2021 12:22 am

Weird error using DISPLAY

Post 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?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Weird error using DISPLAY

Post by Anuj Dhawan »

An educated guess - is the code in correct "area" for DISPLAY? May be show the actual code, a screen shot?
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Re: Weird error using DISPLAY

Post by Taran Bhatia »

Do we use OpenCOBOL in production environments?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”