To pass a TABLE-HANDLE by binding, you must specify the BIND keyword in both the calling and the called routines to tell the AVM to use the same temp-table instance for both routines. If the temp-table that will be used as a pointer is static, use the REFERENCE-ONLY keyword when you define the temp-table. Alternately, if the temp-table that will be used as a pointer is dynamic, set the TABLE-HANDLE parameter to UNKNOWN.

For example, use this syntax in the calling routine:
( { [INPUT] | OUTPUT | INPUT-OUTPUT } TABLE-HANDLE tt-handle BIND.
In the called routine, use this syntax:
DEFINE [ INPUT | OUTPUT | INPUT-OUTPUT ]

    PARAMETER TABLE-HANDLE tt-handle BIND.
In whichever routine that contains the temp-table that is not being used, you should define that temp-table as REFERENCE-ONLY if it is static:
DEFINE TEMP-TABLE temp-table-name REFERENCE-ONLY ...

For example, if you are using the called routine’s temp-table data, you define the calling routine’s static temp-table as REFERENCE-ONLY. If you are using the calling routine’s temp-table data, you define the called routine’s static temp-table as REFERENCE-ONLY.

Alternately, if the unused temp-table is dynamic, you should set the TABLE-HANDLE parameter to UNKNOWN.