CA Global SubSystem › User-defined Functions and ADDRESS Environments › Coding Requirements › Function Coding
Function Coding
When you create a function, you should consider the following:
- Functions cannot preserve data (except in REXX variables) across calls.
- You identify your function to CA‑GSS using the FUNCTION initialization parameter. You can specify the interface type to be either SYNC or ASYNC:
- If you specify SYNC, the function is invoked as a called subroutine. It must not do anything that would release control to the operating system (such as I/O, WAIT, and some SVCs). This is the most efficient interface and is appropriate for functions that manipulate data already in memory.
- If you specify ASYNC, the function is invoked as a subtask, and all processing occurs asynchronously. This isolates other IMODs from waits for I/O, SVCs, and so on.
- When the function is processed under a subtask, it still executes under the authority of the user ID assigned to the IMOD.
- If you access the stack, the stack records are returned to your function in protected storage. If you want to modify the data, you must make a copy in your own storage area.