IGYPS0225-S An "EXEC SQL" statement was found.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Sangitha
New Member
Posts: 5
Joined: Tue Jul 01, 2014 1:34 pm

IGYPS0225-S An "EXEC SQL" statement was found.

Post by Sangitha »

Hi,

I am compiling a COBOL-DB2 pgm. I am getting below error msg.

Code: Select all

IGYPS0225-S An "EXEC SQL" statement was found, but the "SQL" compiler option was not in effect. The statement was discarded. 
the strange thing is, when i am using SQL query inside the copy book I am getting the error but if the call it directly the compilation was successfull.

could you help me?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by nicc »

The SQL recompiler runs before the COBOL compiler. It is the COBOL compiler that brings in the copybook so your SQL statement comes in after the SQL pre-compiler. (The pre-compiler converts the SQL code to COBOL, PL/1 or whatever language you are using that a pre-compiler exists for).
Regards
Nic
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Anuj Dhawan »

Along with what Nic has said, I'd also like to know what "compiling tool" are you using to compile your program?
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.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by William Collins »

To put it another way, you shouldn't have SQL statements in COBOL copybooks if you are using the pre-compiler, because the pre-compiler does not expand copybooks (it would have to re-write them if it did, and that would very quickly become a big mess).

The message is referring to the compiler option SQL, which when on uses the SQL co-processor, directly from the compiler (so no pre-processor step needed). Then the SQL can be in a copybook.

What exactly you've got wrong, we can't guess. Ask your colleagues how they do what you want to do.
Sangitha
New Member
Posts: 5
Joined: Tue Jul 01, 2014 1:34 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Sangitha »

nicc wrote:The SQL recompiler runs before the COBOL compiler. It is the COBOL compiler that brings in the copybook so your SQL statement comes in after the SQL pre-compiler. (The pre-compiler converts the SQL code to COBOL, PL/1 or whatever language you are using that a pre-compiler exists for).
Fine but what should I do to rectify the error now?
Sangitha
New Member
Posts: 5
Joined: Tue Jul 01, 2014 1:34 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Sangitha »

Anuj Dhawan wrote:Along with what Nic has said, I'd also like to know what "compiling tool" are you using to compile your program?
I'm using chaneman for this.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by William Collins »

What exactly you've got wrong, we can't guess. Ask your colleagues how they do what you want to do.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1889
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Robert Sample »

Fine but what should I do to rectify the error now?
Take the EXEC SQL statement out of the copy book and put it in the program.

Or, stop using the precompile and just do the compile with the DB2 option.

Or, talk to your co-workers about how to resolve the issue and follow their advice.

Note that your use of Changeman makes no difference -- if you don't like how it is working, you need to work with your site support group to change it.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Anuj Dhawan »

Sangitha wrote:
Anuj Dhawan wrote:Along with what Nic has said, I'd also like to know what "compiling tool" are you using to compile your program?
I'm using chaneman for this.
If it is so - I'd make an educated guess that you're not telling the changeman that you're compiling a COBOL-DB2 program. To do that, from a distant memory, on some changeman panel, while compiling, you've to mention 'Y' to tell changeman to include 'pre-compiler' step in the underlying compile JCL that changeman will generate.

Having said all that, suggest - you ask around at your shop about this.
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.
Sangitha
New Member
Posts: 5
Joined: Tue Jul 01, 2014 1:34 pm

Re: IGYPS0225-S An "EXEC SQL" statement was found.

Post by Sangitha »

Thanks all.

I was missing to tryn the 'pre-compiler' option as Yes. Making it "Y" has resolved the problem.
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.”