Thanks again to Rob, Chuck and Buck.
Using embedded SQL I can now call the SQL proc and get the
desired doc_num returned.
out_loc = 'ABCD';
cto_num = 1234567;
bat_dat = 1140902;
doc_num = *Blank;
Exec SQL CALL mysqlproc (:out_loc, :cto_num, :bat_dat, :doc_num);
Setting Break Points in the SQL proc worked but I was surprised at the
number of F10-Step and F12-Resume key presses needed to run the proc ?
Next step is making the SQL proc query to get the library/schema name
from the out_loc input parm.
We have a local file which stores library by out_loc, but any hints
on coding this in an SQL proc will be very much appreciated.
(I'm reading 'Stored Procedures' and '7.1 Database SQL' pdf's)
One question I have is what exactly makes an SQL statement 'dynamic' ?
I recently saw a statement that changing a table name requires dynamic
SQL, and have thought for some time that using dynamic sql is more
reliable when switching libraries so that's been my habit for some time.