IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in compiling cobol-db2 programs using cob2 compiler


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Midhun Mohandas

New User


Joined: 03 Mar 2014
Posts: 24
Location: India

PostPosted: Mon Mar 03, 2014 12:56 pm
Reply with quote

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
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Mar 03, 2014 1:05 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 03, 2014 1:27 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Mon Mar 03, 2014 1:35 pm
Reply with quote

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
View user's profile Send private message
Midhun Mohandas

New User


Joined: 03 Mar 2014
Posts: 24
Location: India

PostPosted: Mon Mar 03, 2014 2:35 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 03, 2014 2:41 pm
Reply with quote

You mean you haven't done anything I suggested and you still have a problem?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Mon Mar 03, 2014 3:42 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Mar 03, 2014 8:05 pm
Reply with quote

... and please use "copy/paste" instead of screen shots. See FAQ.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Mar 03, 2014 8:41 pm
Reply with quote

Have you tried specifying the SQL on the *PROCESS (*CBL) statement as shown in the Programming Guide manual?
Back to top
View user's profile Send private message
prasun dhara

New User


Joined: 01 Mar 2008
Posts: 49
Location: kolkata

PostPosted: Thu Apr 03, 2014 11:42 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 04, 2014 1:13 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top