How to see output for an AS/400 stored procedure

Tags:
AS/400 stored procedures
AS400. 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 xxxxNOT DETERMINISTIC CONTAINS SQL EXTERNAL NAME MDIMODS/CL_OI204 PARAMETER STYLE GENERAL
1

Answer Wiki

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

We have a SP that calls a program to get the tax amount and rate from an RPG program… The program has parameters that match the SP.

C     *ENTRY        PLIST                                         
C                   PARM                    CUST#             6   
C                   PARM                    DIV#              2   
C                   PARM                    WH                2   
C                   PARM                    GRSAMT           15 4 
C                   PARM                    FRTAMT           15 4 
C                   PARM                    CITY             18   
C                   PARM                    STATE             2   
C                   PARM                    ZIP               5   
C                   PARM                    JOB#             10   
C                   PARM                    TAXAMT           15 4 
C                   PARM                    TAXRAT            5 5 
 * 
The last 2 parms are returned by the SP for use in our webservice. 
Those are defined by the INOUT..
C/EXEC SQL                             
C+ CREATE PROCEDURE UITAX010PR         
C+ (IN :ECUST CHARACTER (6),           
C+ IN :EDIV CHARACTER (2),             
C+ IN :ESWH CHARACTER (2),             
C+ IN :EGRS DECIMAL (15, 4),           
C+ IN :EFRT 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                              
Hope this helps
                                                         

Discuss This Question: 2  Replies

 
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.
  • CharlieBrowne

    What type of output?

    Report? File? Just Parameters?

    62,385 pointsBadges:
    report
  • bharathtata
    just parameters
    30 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: