SELECT DISTINCT business_unit , prdn_area_code FROM PS_SF_PRDNID_HEADR WHERE ma_prdn_id_flg = 'Y' AND PROD_STATUS IN ('70','90') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_EARNCONCOSTB A WHERE A.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND A.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND A.POSTED_FLAG='N') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_EARNCONCOST B WHERE B.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND B.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND B.POSTED_FLAG='N') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_SCRAPCOSTB C WHERE C.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND C.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND C.POSTED_FLAG='N') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_SCRAPCOST D WHERE D.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND D.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND D.POSTED_FLAG='N') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_VARIANCES E WHERE E.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND E.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND E.POSTED_FLAG='N') AND NOT EXISTS ( SELECT 'X' FROM PS_SF_VARIANCESB F WHERE F.PRODUCTION_ID = PS_SF_PRDNID_HEADR.PRODUCTION_ID AND F.BUSINESS_UNIT = PS_SF_PRDNID_HEADR.BUSINESS_UNIT AND F.POSTED_FLAG='N')
|