Check the syntax of a COBOL program.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
Kishor Bag
Registered Member
Posts: 10
Joined: Thu Jan 16, 2014 4:46 pm

Check the syntax of a COBOL program.

Post by Kishor Bag »

Hi,

Is there any way to check the syntax of a COBOL program with out compiling it actually. Like we have JCL SCAN.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Check the syntax of a COBOL program.

Post by zprogrammer »

Please explain what are you trying to achieve here and based on your explanation you will get better suggestion or even solutions
zprogrammer
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Check the syntax of a COBOL program.

Post by nicc »

There may be syntax checkers out there - did you Google?
But why not:
Put a deliberate error in your program so that it will not go beyond the compile stage then ignore messages for that error.
Regards
Nic
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Check the syntax of a COBOL program.

Post by William Collins »

Given that a COBOL program is likely many hundreds of lines, possible a few thousand, and even tens of thousands, and given that COBOL syntax is a couple of orders of magnitude more complex than JCL, and given that "JCL Checkers" never seem to be up-to-date with what they think that they can deal with, this isn't really something that you want to do. To tie up your "terminal" for several minutes or more is not a good idea.

Standard ISPF has an option to do "foreground" compiles. The fact that you can't see that tells you that your site does not want you doing anything like that.

If you look in the Enterprise COBOL Programming Guide you will find out how to do a syntax-check-only of a COBOL program if you study the compiler options. Indeed, there are many things you can turn off in the compiler if you just want a quick syntax check.
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.”