Db2 actually implements SQL/PSM, which is more than can be said for Sybase/Microsoft SQL Server.
I'm not sure if this extends to all three Db2 variants, namely Mainframe, AS/400 derivatives, and UDB for Linux and Windows (I hope so).
https://en.m.wikipedia.org/wiki/SQL/PSM
IBM supposedly got the PSM code from EnterpriseDB/Postgres.
https://www.enterprisedb.com/news/enterprisedb-and-ibmr-coll...
https://www.internetnews.com/blog/ibm-gets-compatible-with-o...