A stored procedure that contains input and output parameters
In this example, the USERA.IOVCHAR stored procedure has two parameters (an input and an output parameter), which are both defined as VARCHAR 32 KB character strings. The stored procedure copies the input string to the output string.
You can enter your CALL statement with QMF global variables to handle the input and output parameters. The global variables can be declared by using the SET GLOBAL command before you run the CALL statement. If you do not set the value before you run the CALL statement, you are prompted to enter a value. Issue the CALL statement on the SQL QUERY panel. For example:
CALL USERA.IOVCHAR(&A01, &A02)
You enter your data on the lines that are provided in the prompt panel. You must enter a blank for the output parameter regardless of whether you use prompting or you set the global variables before you run the CALL statement. A blank value is shown for the output parameter &A02 in the following figure:
Upon completion, you see this message:
OK, your stored procedure has successfully completed.
You can view the output parameter in the global variable pool by using the SHOW GLOBALS command. This command displays the GLOBALS panel, which is shown in the following figure: