How to: |
Application developers use Dialogue Manager FOCEXEC procedures for program control and flexibility. Additionally, CALLPGM is used where needed.
CALLPGM also provides application developers with:
The following figure illustrates the use of CALLPGM to call a program within a Dialogue Manager FOCEXEC procedure.
The steps in this process are:
Note: CALLPGM may call the program several times to allow it to construct and return complete table data, a complete set of messages, or both. See Passing Parameters for more information.
Note: The program must return messages to the client application before any table data (that is, description of an answer set and the rows of data), or at the end of any table data.
A CREATE TABLE that tells the server the format of the returned data. For more information on describing data, see Writing a 3GL Compiled Stored Procedure Program.
Rows of data, which the client application retrieves using the API function call EDAFETCH.
The Dialogue Manager FOCEXEC procedure itself does not need to create an answer set or message.
The command CALLPGM and EXEC operate the same except EXEC has the advantage of being able to let the EXORDER setting control if FOCEXECs by the same name will be also searched for and which is considered first found (the compiled program or the FOCEXEC.)
CALLPGM progname[,parmval1][,...] END
or
SET EXORDER=PGM/FEX EX[EC] progname[parmval1][,...] END
or
SET EXORDER=PGM/FEX SET SQLENGINE=CPGFOC SQL EX PROGRAM [parmval1][,...] TABLE FILE SQLOUT PRINT field [ON TABLE PCHOLD] END SET SQLENGINE=OFF
where:
Is the name of the program to be run. (If CALLPGM is used, it cannot be another Dialogue Manager FOCEXEC procedure.)
Is an optional positional Dialogue Manager parameter passed to progname. A Dialogue Manager parameter is an alphanumeric value. See Passing Parameters for examples.
The length of a single parameter (for example, parmval1) cannot exceed 32,000 characters. The total length of all specified parameters cannot exceed 32,000 characters.
Is a required command that terminates CALLPGM or EXEC.
iWay Software |