SELECT B.GPBR_DRIVER_SEQ , B.GPBR_DRV_SPLIT_SEQ , B.GPBR_ES_PS FROM %Table(GPBR_DRIVER_DAT) B WHERE B.GPBR_STATUS = 'XRDY' AND B.GPBR_ACTION = 'UPD' AND B.GPBR_PRV_DT IS NOT NULL AND NOT EXISTS( SELECT 'X' FROM %Table(LEG_PRO_TBL_BRA) LEG , %Table(GPBR_DRVJUD_XRF) XRF WHERE XRF.GPBR_DRIVER_SEQ = B.GPBR_DRIVER_SEQ AND XRF.GPBR_DRV_SPLIT_SEQ = B.GPBR_DRV_SPLIT_SEQ AND XRF.COMPANY = LEG.COMPANY AND XRF.PRC_TYPE_BRA = LEG.PRC_TYPE_BRA AND XRF.PROC_NBR_BRA = LEG.PROC_NBR_BRA AND %Sql(FUNCLIB_HR_DATE_MONTH, B.GPBR_PRV_DT) = %Sql(FUNCLIB_HR_DATE_MONTH, LEG.EFFDT) AND %Sql(FUNCLIB_HR_DATE_YEAR, B.GPBR_PRV_DT) = %Sql(FUNCLIB_HR_DATE_MONTH, LEG.EFFDT) )
|