这个SAS AML代码有什么问题

时间:2016-01-18 18:18:19

标签: sas

proc sql noprint;
            CREATE TABLE WORK.TRANS_SENT_TO_USA AS
                    SELECT DISTINCT T3.role_desc , T1.ACCOUNT_KEY , T1.TRANSACTION_KEY ,
                            T2.MOnth_key ,
                            T1.DATE_KEY as DAY ,
                            T1.CURRENCY_AMOUNT_IN_ACCOUNT_CCY as AMOUNT ,
                            T5.ACCOUNT_CURRENCY_CODE as currency ,
                            T6.FULL_NAME,
                            MAX(T4.BANK_NAME) as Ben_Bank
                    FROM DB_CORE.FSC_CASH_FLOW_FACT T1 
                            INNER JOIN DB_CORE.FSC_DATE_DIM T2 
                                    ON T1.DATE_KEY = T2.DATE_KEY
                            INNER JOIN DB_CORE.FSC_CASH_FLOW_BANK_BRIDGE T3
                                    ON T1.TRANSACTION_KEY = T3.TRANSACTION_KEY
                            INNER JOIN DB_CORE.FSC_BANK_DIM  T4
                                    ON T3.BANK_KEY = T4.BANK_KEY
                            INNER JOIN DB_CORE.FSC_ACCOUNT_DIM  T5
                                    ON T1.ACCOUNT_KEY = T5.ACCOUNT_KEY
                            INNER JOIN DB_CORE.FSC_EXT_PARTY_ACCOUNT_DIM T6
                                    ON T1.BENEFICIARY_EXT_PARTY_KEY = T6.EXT_PARTY_ACCOUNT_KEY
                            WHERE T2.CALENDAR_DATE >= "&LAST_RUN_DATE"D
                                            AND T3.ROLE_DESC like '%BENEFICIARY%'
                                            AND T4.BANK_COUNTRY_CODE LIKE 'US%'
                            Group by  T3.role_desc ,T1.ACCOUNT_KEY , T1.TRANSACTION_KEY ,
                                            T2.MOnth_key ,
                                            T1.DATE_KEY  ,
                                            T1.CURRENCY_AMOUNT_IN_ACCOUNT_CCY  ,
                                            T5.ACCOUNT_CURRENCY_CODE ;
    RUN;     

1 个答案:

答案 0 :(得分:0)

FULL_NAME不在GROUP BY中。这应该会引起问题,但是你再没有具体描述你的问题。