Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem in compiling cobol-db2 programs using cob2 compiler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Problem in compiling cobol-db2 programs using cob2 compiler
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Mar 03, 2014 1:27 pm    Post subject: Reply to: Problem in compiling cobol-db2 programs using cob2
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon Mar 03, 2014 1:35 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Mar 03, 2014 2:41 pm    Post subject: Reply to: Problem in compiling cobol-db2 programs using cob2
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon Mar 03, 2014 3:42 pm    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Mon Mar 03, 2014 8:05 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Mon Mar 03, 2014 8:41 pm    Post subject:
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    Post subject: Reply to: Problem in compiling cobol-db2 programs using cob2
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: 7913
Location: Bellevue, IA

PostPosted: Fri Apr 04, 2014 1:13 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us