20 pts.
 Create a Stored Procedure using CL and RPGLE programs
I have an RPGLE program called from a CL program for database files overrides. I want to call the same programs from a stored prodecure on SQL Server from within a Web application. I am brand new to SQL Server but am pretty good on the AS400.

Software/Hardware used:
ASKED: June 12, 2009  3:17 PM
UPDATED: August 26, 2009  1:14 PM

Answer Wiki:
CREATE PROCEDURE ABCSP( IN PARM1 CHAR(1), IN PARM2 NUMERIC(9,0), IN PARM3 NUMERIC(9,0)) LANGUAGE RPGLE RESULT SET 1 NOT DETERMINISTIC MODIFIES SQL DATA EXTERNAL NAME ABCRPG( program name ) PARAMETER STYLE GENERAL Type of Sp as like SQLSPE Create and compile your CL on the AS400 as normal. Then from a command line type STRSQL and enter the following code. <pre>CREATE PROCEDURE library/clpgm (IN parm1 DEC(3), IN parm2 CHAR(10)) RESULT SETS 1 EXTERNAL NAME library/clpgm LANGUAGE CL NOT DETERMINISTIC NO SQL PARAMETER STYLE GENERAL You should receive a message back: Procedure clpgm was created in library You can have as many IN and OUT parms as you need, the must be exactly defined. Also as long as you don't change your parms you can change the CL on the AS400 and recompile without recreating the procedure. If you need to recreate the procedure it is: <pre>DROP PROCEDURE library/clpgm Then you can Create it again. I have had problems with using the DEC parms so I always convert them to CHAR in the CL before using.</pre></pre>
Last Wiki Answer Submitted:  August 26, 2009  1:14 pm  by  poorboy01   90 pts.
All Answer Wiki Contributors:  poorboy01   90 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _