SELECT D.SETID ,A.DEPTID ,A.POSITION_NBR ,L.LANGUAGE_CD ,L.DESCR ,L.DESCRLONG FROM PS_POSITION_DATA A , PS_DEPT_TBL D , PS_POSN_DATA_LANG L WHERE D.SETID=( SELECT Z.SETID FROM PS_SET_CNTRL_REC Z WHERE Z.SETCNTRLVALUE=A.BUSINESS_UNIT AND Z.RECNAME='DEPT_TBL') AND D.DEPTID=A.DEPTID AND D.EFFDT = ( SELECT MAX(E.EFFDT) FROM PS_DEPT_TBL E WHERE E.DEPTID = D.DEPTID AND E.SETID=D.SETID AND E.EFFDT<=%CurrentDateIn) AND A.EFF_STATUS = 'A' AND A.BUDGETED_POSN = 'Y' AND A.EFFDT = ( SELECT MAX(B.EFFDT) FROM PS_POSITION_DATA B WHERE A.POSITION_NBR = B.POSITION_NBR AND B.EFFDT <= %CurrentDateIn) AND A.MAX_HEAD_COUNT > ( SELECT COUNT(*) FROM PS_POSN_INCUMBENT C WHERE A.POSITION_NBR = C.POSITION_NBR) AND A.POSITION_NBR = L.POSITION_NBR
|