Showing posts with label Stored Procedure. Show all posts
Showing posts with label Stored Procedure. Show all posts

Friday, September 27, 2013

DB2 Stored Procedure Last Used Date

Ever wonder when was a stored procedure last used/invoked in DB2 LUW? Knowing this may be helpful in determining whether a stored procedure is still in use or how recently it was used. Run this query to find this information.

SELECT PR.PROCSCHEMA
      ,PR.PROCNAME
      ,PK.LASTUSED
  FROM SYSCAT.PROCEDURES PR
      ,SYSCAT.ROUTINEDEP RD
      ,SYSCAT.PACKAGES   PK
 WHERE PR.SPECIFICNAME =  RD.ROUTINENAME
   AND RD.BNAME        =  PK.PKGNAME
   AND PR.PROCSCHEMA  <> 'SYSIBMADM'
   AND PK.LASTUSED     > '01/01/0001'
 ORDER BY PK.LASTUSED DESC
  WITH UR;

Remember that, you can use this query only from DB2 LUW V9.7 onwards.

Monday, December 1, 2008

CA Intertest (Batch) Tips

If you use CA's Intertest for Batch to debug your batch COBOL programs or stored procedures, read on.

There are a few commands that you use frequently. Set them commands in PFKEYS for ease of use:

STEP 1 - Set steps to go in each run to 1 (I usually set it to PF4)
GO - Run as many steps as described in the STEP command (I usually set it to PF5)
RUN - Run until the next breakpoint (I usually set it to PF6)
KUP - Scroll Up in the Data Display Window (I usually set it to PF17)
KDOWN - Scroll Down in the Data Display Window (I usually set it to PF18)