View previous topic :: View next topic
|
Author |
Message |
Midhun Mohandas
New User
Joined: 03 Mar 2014 Posts: 24 Location: India
|
|
|
|
Hello,
I am trying to execute a cobol-db2 program using cob2 compiler in OMVS region.
The syntax I gave is "cob2 programname.cbl" but the following error message is showing " An exec sql statement was found but the sql compiler option was not in effect. the statement was discarded".
The same program is working fine in MVS region.
Please help me in solving this problem. |
|
Back to top |
|
|
sureshpathi10
Active User
Joined: 03 May 2010 Posts: 154 Location: Kuala Lumpur
|
|
|
|
Its seems like something wrong with your compile JCL.
You've to use COBOL-DB2 compiler. Please search in Web for more details. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Compare your compile options between the two environments. Unless you are going to use an SQL pre-processor, your SQL compiler options need to be the same. Take the opportunity to review all compiler options (should have been done before the first compile) so you don't end up chasing differences which are just to do with the way you have compiled. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
As mentioned here..please review the compiler job between two regions and it looks like DB2 pre compiler is missing and point the correct Dclgen and copybook libs in the job. |
|
Back to top |
|
|
Midhun Mohandas
New User
Joined: 03 Mar 2014 Posts: 24 Location: India
|
|
|
|
I have already exported steplibs for a program(DSNHPC) to precompile the cobol-db2 program, to OMVS region.
Moreover now I am declaring host-variables inside program itself, therefore no need for DCLGEN.
But still I am facing the same problem that says " An exec sql statement was found but the sql compiler option was not in effect. the statement was discarded"
What might the reason for this ?
Help me to solve this issue |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You mean you haven't done anything I suggested and you still have a problem? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
There could be many reasons as we guess ..so instead why don't you show us compile jcl, cobol program where the SQL is used. However you might wants to check on..
1. the sql option wasn't enabled to use the DB2 precompiler in the Enterprise Compiler.
2. Syntax error
3. If any SQL is declared in copybook then use them as a INCLUDE instead. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
... and please use "copy/paste" instead of screen shots. See FAQ. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Have you tried specifying the SQL on the *PROCESS (*CBL) statement as shown in the Programming Guide manual? |
|
Back to top |
|
|
prasun dhara
New User
Joined: 01 Mar 2008 Posts: 49 Location: kolkata
|
|
|
|
Are u sure that ur precompile step executed successfully ? Have u verified the output of precompile (modified COBOL pgm) ? If yes then have u verified if this output is correctly fed to the compiler ? There can be many problem in your compile JCL.. Unless u provide us the compile JCL you are using ,it will be difficult to find out the reason |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
prasun dhara: OMVS does not use JCL -- it is the Unix environment under z/OS. There is no compile JCL to be provided, hence your request for the compile JCL makes no sense in the problem context. |
|
Back to top |
|
|
|