They didn't when I used to use it. But, it looks like they've added what they call [link|http://www-3.ibm.com/software/data/db2/udb/ad/v7/adg/db2a0/sqlproc.htm#HDRPSMUSNG|SQL Stored Procedures]

Back when I used DB2, you wrote your stored procedure/function in REXX, C, or COBOL and then registered it into the database. It was a painful process.

I have not used the SQL Stored Procedure, but it looks like it fits what you're asking.

-Mike