How to call stored proc from a cobol module



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

How to call stored proc from a cobol module

Postby russel » Wed Feb 13, 2013 4:37 pm

Hi all
i want to call a stored procedure from a cobol module
i am using following way to achieve that but i am getting sql error -444 (user program could not be found)

EXEC SQL
CALL <SP_NAME> (:LS-INPUT,
:LS-OUTPUT)
END-EXEC

I have compiled the SP module as C37NSP31module
russel
 
Posts: 7
Joined: Wed Feb 13, 2013 4:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to call stored proc from a cobol module

 

Re: How to call stored proc from a cobol module

Postby pmartyn » Fri Mar 01, 2013 12:23 am

It sounds like you forgot the CONNECT call
EXEC SQL
CONNECT TO dev (WHATEVER)
END EXEC

then perform your call. Remember do not check for SQLCODE = ZERO. Check for sqlcode +466 instead and comtinue processing.

These users thanked the author pmartyn for the post:
pulsar22 (Wed Sep 25, 2013 9:07 pm)
pmartyn
 
Posts: 42
Joined: Thu Feb 28, 2013 7:11 pm
Has thanked: 5 times
Been thanked: 3 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post