How do AS/400 stored procedures get output?

Tags:
AS/400
AS/400 stored procedures
CL Program
RPG
I have created a CL which calls an RPG program. Now I have to create a stored procedure which calls the CL! As RPG normally sends back the output to CL! How should I send back the output to SP? Will SP normally pick it or is there any command to send back the output to stored procedure (SP). I have created the SP by giving the below command in DB2 SQL.
CREATE PROCEDURE xxxxx/SP_xxxx(IN xxx CHAR ( 1), IN xxx CHAR (, OUT output xxxx ( xxxx)) NOT DETERMINISTIC CONTAINS SQL EXTERNAL NAME MDIMODS/CL_OI204 PARAMETER STYLE GENERAL


Software/Hardware used:
as400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Parameters on your Stored Procedure and CL Program should Match. It will automatically considers. You can execute the Stored Procedure and see the results on iSeries Navigator for Testing.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    We have a few SP that are called and return data from our DB2 database. for example this one runs our tax calculation program to return the tax amount and the tax rate. These parameter match the RPG program.
    C/EXEC SQL                               
    C+ CREATE PROCEDURE UITAX010PR           
    C+ (IN :ECUST CHARACTER (6),             
    C+ IN :EDIV CHARACTER (2),               
    C+ IN :ESWH CHARACTER (2),               
    C+ IN :EGROSS DECIMAL (15, 4),             
    C+ IN :EFREIGHT DECIMAL (15, 4),             
    C+ IN :ECITY CHARACTER (18),             
    C+ IN :EST CHARACTER (2),                
    C+ IN :EZIP CHARACTER (5),               
    C+ IN :EJOB CHARACTER (10),              
    C+ INOUT :ETAX DECIMAL (15, 4),          
    C+ INOUT :ERATE DECIMAL (5, 5))          
    C+ RESULT SETS 1 LANGUAGE RPG SPECIFIC   
    C+ UITAX010PR NOT DETERMINISTIC          
    C*+ MODIFIES SQL DATA                    
    C+ EXTERNAL NAME                         
    C+ UITAX010 PARAMETER STYLE GENERAL      
    C/END-EXEC                               
    

    131,605 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: