Progress/400
Product Guide
Progress/400 Stored Procedure Support
The Progress/400 Product allows you to call OS/400 programs from within a Progress 4GL procedure.
A stored procedure as it pertains to DB2/400 and Progress/400 is any program object (Type = *PGM) created with any of the available languages on OS/400: CL, RPG/400, ILE RPG/400, COBOL/400, ILE COBOL/400, ILE C/400, PL1/400, FORTRAN/400, or REXX. A stored procedures within a Progress 4GL-based application can enhance performance of batch-style functions. Any sort of a bulk database manipulation or specialized calculation that takes an excessive amount of time is a candidate for a program to run as a stored procedure.
The Progress/400 Data Dictionary allows you to define and maintain procedures and their parameters. Procedure definitions are stored in the P__FILE file, and parameter definitions are stored in the P__FIELD file. When Progress synchronizes the schema holder, the schema image maintains this information in the _file and _field files marked as type AS/400 Procedures. See "Remote Client DB2/400 Utilities," for information about maintaining stored procedures.
Table 11–5 lists information contained in a stored procedure.
You run stored procedures from within Progress procedures by using the 4GL RUN STORED-PROC statement. The OS/400 procedure that you run with this statement can return two types of values:
If a stored procedure fails a run time, you will receive the error “Unable to Open File.” Press ENTER and a dialog box appears with the specific AS/400 message that caused the stored procedure to stop.
Stored procedures called from within Progress applications cannot return Dates or RECID data types. Table 11–6 lists the supported data types.
A maximum of 32 parameters can be defined for each procedure. Each procedure must have a unique name. Therefore, you cannot redefine a procedure with different sets of parameters without duplicating the program in the listed library.
The Progress 4GL has statements and functions that allow you to use the return codes and values of the output parameters. Table 11–7 lists these statements and functions.
The following sections describe how to run Progress/400 stored procedures and retrieve return codes and output parameter values.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |