Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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: 1788
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: 7315

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: 1788
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: 1249
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: 8154
Location: East Dubuque, Illinois, USA

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: 8154
Location: East Dubuque, Illinois, USA

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
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us