A stored procedure on the AS/400 is created in any SQL environment (CREATE PROCEDURE).
This is a permanent object and like C objects it is recognized by it's name and parameters.
Is callable from any SQL environment.
Defines the variables to be passed in and returned and return sets.
Can contain a body of SQL commands
or
Can reference a native language pgm (RPGLE, CL, CLLE, CBLLE)
These are most frequently used to support external programs (VB, Java, etc.)
Here are a few sites located with AS/400 Stored Procedures - hundreds more.
http://search400.techtarget.com/generic/0,295582,sid3_gci1049543,00.html
http://www.mcpressonline.com/programming/general/as/400-stored-procedures-to-the-rescue.html
Phil
Here is a sample stored procedure SP creating in LIB library with input parameter VAR1.
CREATE PROCEDURE LIB/SP (IN VAR1 CHAR(8))
LANGUAGE SQL
P1: BEGIN
DECLARE [Variables];
..
..
set [Variable] = …;
END P1