Thursday, March 21, 2019

Read dynamic statement cache full sql text IFCID 316 IFCID 317

This Rexx reads "dynamically" the dynamic statement cache with basic statistics on the  each SQL execution. It uses IFCID 316 and IFCID 317 (to get the full sql text )
With IFCID316 and IFCID 401 you have all executed statements at hand

Get the code here
https://github.com/ndt98/Db2z/blob/master/ifc316.rex


Rexx to decode IFCID 366 and IFCID 376 with sql statement for dynamic SQL

Finding SQL using incompatible functions is easy with static SQL as the package  and the statement number is provided, but it is difficult for dynamic SQL.
This Rexx captures IFCID 366/376 and for each  SQL statement returned , it reads IFCID 317 to get the full sql text in the case of dynamic SQL.

Last update : 27/05/2020

Get the rexx here : https://github.com/ndt98/Db2z/blob/master/ifc376f.rex