I have a block of code that is repeated within a DB2 stored procedure. I would like to separate this out into a new procedure that I can call with parameters and have it return a value.
How do I create a procedure to return a value and how do I call this procedure from inside my original procedure?