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

Stored Procedure Returning Incorrect value


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

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Nov 03, 2010 5:45 pm
Reply with quote

I don't do cobol anymore.
I'll try to get a cobol test pgm when I have the time.

At least now you/I know it's not your SP.
Back to top
View user's profile Send private message
raj1984

New User


Joined: 28 Oct 2010
Posts: 16
Location: India

PostPosted: Wed Nov 03, 2010 5:50 pm
Reply with quote

Thanks Guyc for your support.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Nov 03, 2010 6:09 pm
Reply with quote

extract :
Code:
WORKING-STORAGE.
...
01  ws-misc.                                             
    05  ws-invar                pic  x(09).             
...
PROCEDURE DIVISION.
    move 'XXX' to ws-invar             
    display 'Befor[' ws-invar ']'     
    exec sql                           
        CALL myuserid.GUYCTEST(:ws-invar)
    end-exec                           
    perform sqlstate-check       
    display 'After[' ws-invar ']'     
    goback
    .
...

returns :
Code:
Befor[XXX      ]
After[10       ]
Back to top
View user's profile Send private message
raj1984

New User


Joined: 28 Oct 2010
Posts: 16
Location: India

PostPosted: Fri Nov 12, 2010 11:53 am
Reply with quote

Thanks GuyC..

It does not run it my shop.. Did you bind WLM (store procedure environment) while registering the SP ?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Nov 15, 2010 2:14 pm
Reply with quote

bind wlm ?
The stored procedure is native, so no extra binding steps are necessary.
I precompiled/compiled/linked/bound the calling program just like any other DB2 program.
Back to top
View user's profile Send private message
raj1984

New User


Joined: 28 Oct 2010
Posts: 16
Location: India

PostPosted: Tue Nov 16, 2010 11:45 am
Reply with quote

Thanks GuyC,

Infact i did the same. It is not working in my system. Instead of cobol , we tried to hit the SP from Java , it is working fine.

Seems that it is issue with COBOL program.

Thoughts?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Nov 16, 2010 3:03 pm
Reply with quote

not if your sqlcode is still 000.
Could be something with (descending plausiblility):
- parameter style : GENERAL WITH NULLS vs PARAMETER STYLE GENERAL
- different versions of the same SP.
- APF-authorized WLM Environments
Back to top
View user's profile Send private message
raj1984

New User


Joined: 28 Oct 2010
Posts: 16
Location: India

PostPosted: Thu Nov 18, 2010 8:46 am
Reply with quote

Thanks GuyC and Others.

Finally it is working now.

Thanks
Rajesh
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Nov 18, 2010 12:52 pm
Reply with quote

thx for letting us know.
What was the final problem?
Back to top
View user's profile Send private message
raj1984

New User


Joined: 28 Oct 2010
Posts: 16
Location: India

PostPosted: Thu Nov 18, 2010 12:59 pm
Reply with quote

Solution suggested by our DBA was to change the variable name.
I declared V_ACT_ID in SP and declared same variable in program as well.
But he wanted to change the name of variable . Basically same variable (name ) should not be used in both SP and COBOL pgm.

Seems to be strange but it is working .

Thanks
Rajesh
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Stored procedure cpu utilization DB2 1
Search our Forums:

Back to Top