SELECT DISTINCT A.CAL_RUN_ID ,A.DESCR FROM PS_GP_CAL_RUN A ,PS_GP_OPR_RULE_PRF B WHERE (A.RUN_FINALIZED_IND = 'Y') AND (B.USED_BY = 'A' OR A.COUNTRY = B.COUNTRY) AND ((OFF_CYCLE<>'Y' AND EXISTS ( SELECT 'X' FROM PS_GP_CAL_RUN_DTL DTL WHERE A.CAL_RUN_ID = DTL.CAL_RUN_ID AND DTL.CALC_TYPE = 'A')) OR OFF_CYCLE = 'Y') AND (NOT EXISTS ( SELECT 'X' FROM PS_GP_ABS_INTF_LOG I WHERE I.CAL_RUN_ID=A.CAL_RUN_ID AND I.ABS_PAY_SYSTEM_CD='PI' AND I.STRM_NUM=0) OR EXISTS ( SELECT 'X' FROM PS_GP_CAL_RUN_STRM S WHERE S.CAL_RUN_ID=A.CAL_RUN_ID AND S.STRM_NUM>0 AND NOT EXISTS ( SELECT 'X' FROM PS_GP_ABS_INTF_LOG J WHERE J.CAL_RUN_ID=S.CAL_RUN_ID AND J.ABS_PAY_SYSTEM_CD='PI' AND J.STRM_NUM=S.STRM_NUM)))
|