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

SQLCODE = -923/-927 in COBOL DB2 batch program


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

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Wed Oct 19, 2011 4:41 pm
Reply with quote

Hi,
We have a COBOL-DB2 batch program having one or more subprograms in it accessing DB2 tables. We have loaded all the required DB2 tables in one specific/dedicated region and also bound the necessary plans.

But while executing this batch job with proper SSID and PLAN NAME, our job is failing continuously due to -923 or -927 i.e. DB2 interface/DB2 connection issues.

We are trying to browse/edit tables through FILE-AID option for DB2, its giving us connection in this case but not when we execute query from our program. Even if we put the queries from our program in to SPUFI, then also it executes. icon_redface.gif

We tried to resolve this since a long time but not getting any clue. icon_evil.gif

Can any one help me to dig out this issue ?

Thank you in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 19, 2011 4:46 pm
Reply with quote

Quote:
our job is failing continuously
???
just choose to clarify the language barrier
1) always
2) most of the times
3) some of the times
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Wed Oct 19, 2011 4:56 pm
Reply with quote

sorry for the confusion.

It is failing always.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 19, 2011 5:00 pm
Reply with quote

had this issue occured yesterday,
i could understand why you have made little headway.

but,
since it has been for a long time,
and the issue is a connection issue
ONLY IN BATCH

either your invokation procedure is not correct.....what is it?
or you have not proper linked/steplib'd the proper DSNSL??? modules.
what are your steplib dsn's?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 19, 2011 5:02 pm
Reply with quote

do you have anything at your site that does work?

if so,
start comparing.

start with the pre-compiler option (TSO, etc...)
then the syslnin libraries
then the steplib for execution
then the EXEC parm in your job.....
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Oct 19, 2011 6:35 pm
Reply with quote

Suggest you talk with your DBA. File-Aid for DB2, SPUFI and "user written COBOL DB2 program" are different animals. If you are able to access the tables using File-Aid or SPUFI - that does not guarantee that you've done all the set-ups correct from COBOL-DB2 program per se.

At one of the shops, a DB2 Stored-procedure was giving -927, the schema looked correct - everything fine, the way you said but then from DBA end they needed to add some "check" in some in-house screen - well, such things can't be answered via a Forum...check for such possibilities too.
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Wed Oct 19, 2011 7:30 pm
Reply with quote

Thank you all for you inputs.

1. Yes, we had few such jobs which executed before this unsuccessful job without any severe issue. Only difference was that, those tables were in different region and had different plan names, SSID etc.

2. Also we compared this unsuccessful job with those which went on right.
All load libraries for programs/subprograms/PLAN etc are right.

3. Again, will review the things and will contact DBA in case if does not work at all.

I have a doubt --

Is this anything related to improper binding ?
Back to top
View user's profile Send private message
Mithun MF

New User


Joined: 09 Sep 2010
Posts: 7
Location: Chennai

PostPosted: Wed Oct 19, 2011 10:27 pm
Reply with quote

Hello Roshan,

I have came across this kind of issue.
1. Are you executing job has the BMC
2. The Main program has the static/dynamic calls for the subroutine.

If your subprogram is dynamic call then use 'cbl dynam' statement before the identification division.

If your subprogram is static call then link your subprogram with NCAL. Hope this resolve your issue.

Thanks,
Mithun
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Thu Oct 20, 2011 10:27 am
Reply with quote

Thanks mithun,

I have tried all the possible inputs provided.

We cant modify the program as it is production one.

So, i guess this problem is related to 'invoking way to DB2' while calling SQL from cobol-db2 batch program as it fails at first query fire itself.
OR
something is wrong with BIND.

Also BIND was successful, so we are more confused.

Error is still there with -927 SQLCODE.
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Thu Oct 20, 2011 10:46 am
Reply with quote

this is the job step where it is failing while calling first SQL:
please let me know if we are going wrong some where

Code:
//STEP030  EXEC PGM=IKJEFT1B,                                 
//PARM=('%DB2BATCH','SYS(&SSID)','PROG(PGMNAME)',
//             'PLAN(PLANNAME')                                 
//STEPLIB  DD DSN=&BASEBB.LOAD,DISP=SHR                       
//         DD DSN=&BASECW.LOAD,DISP=SHR                       
//         INCLUDE MEMBER=&DB2INCL                           
//SYSPROC  DD DSN=PGDF.BASE.CLIST,DISP=SHR                   
//MERGEXTR DD DSN=&&MGEXTR,DISP=(OLD,DELETE)                 
//CUSTKEYS DD DSN=&&CUSTKEYS,DISP=(OLD,DELETE)               
//EXTRFILE DD DSN=NEWFILE,   
//             DISP=(NEW,CATLG,DELETE),RECFM=FB,             
//             LRECL=1200,DATACLAS=&DCLAS                     
//XIOSTAT1 DD SYSOUT=*                                       
//VIOSTAT1 DD SYSOUT=*                                       
//SYSOUT   DD SYSOUT=*                                       
//SYSUDUMP DD SYSOUT=C                                       
//SYSABOUT DD SYSOUT=C                                       
//SYSTSPRT DD SYSOUT=*                                       
//SYSTSIN  DD DUMMY                                           
                                   

Let me try by providing control card in SYSTIN DD --- with RUN
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 20, 2011 7:31 pm
Reply with quote

Hello,

Quote:
We cant modify the program as it is production one.
Nonsense. . . The most modified code in the world is production code. . .

If it is broken, it needs to be fixed.

As an expirement, you might clone this program to another name and re-do everything (compile/link/bind/etc) and see if the new code works properly or has the same problem.
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 Using API Gateway from CICS program CICS 0
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top