To review, the following table summarizes the possible combinations of temp-table parameter definitions in the routine making the call and the routine being called, along with their effects on the temp-table.

Table 1. Temp-table parameter definitions
Caller RUN statement form Callee parameter form Parameter type Result
TABLE ttXYZ
TABLE ttXYZ
INPUT
Static temp-table ttXYZ in the caller is copied to the static definition of ttXYZ in the callee. The table definition is passed along with the data for validation only.
TABLE ttXYZ
TABLE-HANDLE hTT
INPUT
Definition and data of static temp-table ttXYZ in the caller are copied to the callee, which constructs a dynamic definition using handle hTT and loads the dynamic table with the data.
TABLE-HANDLE hTT
TABLE ttXYZ
INPUT
Definition and data of dynamic temp-table whose handle is hTT in the caller are copied to the callee, which receives the data into its static definition ttXYZ.
TABLE-HANDLE hTT
TABLE-HANDLE hTT
INPUT
Definition and data of dynamic temp-table whose handle is hTT in the caller are copied to the callee, which receives the definition and uses it to construct a dynamic temp-table using handle hTT, then loads the data into this dynamic table.
TABLE ttXYZ
TABLE ttXYZ
TABLE-HANDLE hTT
TABLE-HANDLE hTT
TABLE ttXYZ
TABLE-HANDLE hTT
TABLE ttXYZ
TABLE-HANDLE hTT
OUTPUT
All the same combinations are supported. Nothing is passed in to the callee. The definition of the table and its data are passed back in the same form from callee to caller when callee returns. For the OUTPUT TABLE form, the definition is used to validate compatible temp-table definitions; for the OUTPUT TABLE-HANDLE form, it is used to construct the temp-table in the caller.
TABLE ttXYZ
TABLE ttXYZ
TABLE-HANDLE hTT
TABLE-HANDLE hTT
TABLE ttXYZ
TABLE-HANDLE hTT
TABLE ttXYZ
TABLE-HANDLE hTT
INPUT-OUTPUT
Once again, the same combinations are supported. The table definition and data are passed in from caller to callee. Callee can make changes to the data in the table, which is returned by being copied back to the caller.
HANDLE
HANDLE
Any Local only. Cannot be used on a remote call. The handle points to the temp-table instance in the caller (for INPUT and INPUT-OUTPUT modes) or the called routine (for OUTPUT mode). Only dynamic references to the temp-table are possible.