SELECT A.EMPLID , B.SYSTEM_SOURCE , C.NAME , E.HOLIDAY_SCHEDULE FROM %Table(RS_WORKER_TBL) A , %Table(RS_WRKR_EFFDT) B , %Table(PERSONAL_DATA) C , %Table(JOB) E WHERE A.EMPLID = B.EMPLID AND B.SYSTEM_SOURCE = 'RS' AND A.EMPLID = C.EMPLID AND B.EMPLID = E.EMPLID AND B.EMPL_RCD = E.EMPL_RCD AND B.EFFDT = ( SELECT MAX(D.EFFDT) FROM %Table(RS_WRKR_EFFDT) D WHERE B.EMPLID = D.EMPLID AND D.SYSTEM_SOURCE = B.SYSTEM_SOURCE AND D.EFFDT <= %CurrentDateIn) AND B.WRKR_INELIGIBLE = 'N' AND E.EFFDT = ( SELECT MAX(F.EFFDT) FROM %Table(JOB) F WHERE E.EMPLID = F.EMPLID AND E.EMPL_RCD = F.EMPL_RCD AND F.EFFDT <= %CurrentDateIn) AND E.EFFSEQ = ( SELECT MAX(G.EFFSEQ) FROM %Table(JOB) G WHERE E.EMPLID = G.EMPLID AND E.EMPL_RCD = G.EMPL_RCD AND E.EFFDT = G.EFFDT ) AND E.EMPL_STATUS = 'A'
|