1) Use the Debug facility provided by Dev Centre (was known SPB in V7). You can build the proc for debug and run in debug mode by stepping through each line in your SP . You can also create breakpoints
2) Use the sample UDF provided in http://www-106.ibm.com/developerwork...0302izuha.html
Visit the new-look IDUG Website , register to gain access to the excellent content.