View previous topic :: View next topic
|
Author |
Message |
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
removed "EXTERNAL NAME PBP00010 " also ? |
|
Back to top |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
Yes GuyC , both FENCED and EXTERNAL are removed.
Below is my SP procedure:
Code: |
CREATE PROCEDURE BP.PBP00024 (INOUT V_ACT_ID char(09))
-- FENCED
RESULT SETS 0
-- EXTERNAL NAME PBP00024
LANGUAGE SQL
MODIFIES SQL DATA
COLLID CBP001BD
-- PARAMETER STYLE GENERAL
NOT DETERMINISTIC
ASUTIME NO LIMIT
PROGRAM TYPE MAIN
SECURITY DB2
COMMIT ON RETURN NO
STAY RESIDENT NO
|
|
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
this works on my side :
Code: |
--drop PROCEDURE GUYCTEST ;
CREATE PROCEDURE GUYCTEST (INOUT V_ACT_ID char(9))
RESULT SETS 0
LANGUAGE SQL
MODIFIES SQL DATA
COLLID CBP001BD
NOT DETERMINISTIC
ASUTIME NO LIMIT
PROGRAM TYPE MAIN
SECURITY DB2
COMMIT ON RETURN NO
STAY RESIDENT NO
BEGIN
DECLARE v_base_n2 INTEGER;
SET v_base_n2 = 10;
SET V_ACT_ID = char(v_base_n2);
--
--
END |
|
|
Back to top |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
It works for me when i run it standalone(we have AQT tool through which i can run the SP).
However , when i call it through COBOL program , it returns no value .. |
|
Back to top |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
Please let me know , how did u run it ?
through COBOL ? |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
Thanks Guyc for your support. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
Thanks GuyC..
It does not run it my shop.. Did you bind WLM (store procedure environment) while registering the SP ? |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
Thanks GuyC and Others.
Finally it is working now.
Thanks
Rajesh |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
thx for letting us know.
What was the final problem? |
|
Back to top |
|
|
raj1984
New User
Joined: 28 Oct 2010 Posts: 16 Location: India
|
|
|
|
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 |
|
|
|