Tuesday 6 January 2009

One Step Beyond

One of Time Admin's subprograms, TL_TA000800, calls TL_TA_RULES to apply rules in the order specified on the rule program for each batch. The sections in TL_TA_RULES correspond to each of the active time and labor rules.

When a rule is built the application engine definition tables underlying TL_TA_RULES are updated to reflect any changes made to the rule.

Unfortunately, for a particular rule, the section name and step of the app engine don't correspond to the rule name and step number of the rule itself. Which can make it a little tricky when debugging an abend. The following SQL solves this problem by giving you the rule ID and step for the app. engine section and step that the abend log will give you.


select *
from ( select TL_RULE_ID,
TL_RULE_STEP,
rownum as AE_STEP,
SQL_ID,
DESCR100
from PS_TL_RULE_STEPS
where TL_RULE_ID = (select TL_RULE_ID
from PS_TL_RULE_DEFN
where AE_SECTION = :AE_SECTION)
)
where AE_STEP = :STEP