Progress/400
Product Guide
The PROCALL Program
The PROCALL program allows the OS/400 HLL to call and pass parameters to a Progress 4GL program. PROCALL accepts up to 32 parameters. The first is the name of the called program, and the remaining parameters are used to pass input to and output from the Progress 4GL program.
The following CL and RPG programs demonstrate how to use the PROCALL program. The Progress 4GL program demonstrates how the 4GL handles entry parameters:
PROCALL Parameters
PROCALL can accept up to 32 parameters. The first parameter must be the name of the Progress 4GL program name that you want to call. You must pass a name that conforms to IFS naming conventions. If the stream file does not exist, Progress/400 displays an error and the call to PROCALL does not complete normally. PROCALL is designed primarily for RPG and CL, hence the first parameter must be defined as a 128-byte character field and must be space padded on the right. It cannot be NULL terminated.
Progress/400 considers any other parameters passed to the PROCALL program to be parameters to the 4GL program. These parameters must also be passed using the RPG or CL standards. The following rules apply:
- All parameters passed to a 4GL program must be declared in the calling program exactly as they are declared in the called Progress 4GL program. You use the EPI ENTRY command to declare the parameters input to the 4GL program. See the "EPI ENTRY Command" section for details.
- Character strings passed to the 4GL program must be declared as a fixed length; they cannot be NULL terminated. In the previous examples, &PARM1 is defined as a 50-byte character string in the RPG and CL programs, and it is declared as a 50-byte character string in the EPI ENTRY command in the Progress program.
- Just as in a CL or RPG program, a Progress 4GL program can accept numeric parameters. The numeric types supported are packed, zoned, and integer.
If you pass more than 32 parameters to PROCALL, it returns an error.
For a table of rules to follow when defining the mapping between Progress and OS/400 data types, see the "DB2/400-to-Progress Data Type Mapping" section in Common Product Information."
EPI ENTRY Command
When you call a Progress 4GL program, the external parameters passed to the 4GL are defined using the EPI ENTRY command. Progress uses the same syntax for the EPI ENTRY command and for the EPI CALL command, except that with EPI ENTRY you need not specify the PGM parameter.
Once you run the EPI ENTRY command, the shared variables set up in the PARM parameters are assigned the values passed from the PROCALL program. You define parameters for EPI ENTRY using the PARM parameter. The USE parameter of the PARM keyword has the following meaning:
Here is an example of the EPI ENTRY command:
EPI EXIT Command
Use the EPI EXIT command to send parameters back to the caller. The command does not have parameters; its only purpose is to save the shared variable values declared in the EPI ENTRY command so that the calling HLL program can retrieve them.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |