I have a dataset that that appears as below. There may be multiple COD_MOT_RSPS_TRAN codes for the same SCORE_CUSTOMER_ACCOUNT_XID, TRANSACTION_DTTM and TRANSACTION_AMT: I sorted with the following code: proc sort data=work.final_decision; by score_customer_account_xid transaction_dttm transaction_amt cod_mot_rsps_tran; run; What I want to do next is to create another dataset that gives me only the 1st observation by COD_MOT_RSPS_TRN if there are multiple and all other column values are equal (account, datetime, and amount fields). As an example, here are two observations with the same account and timestamp, but with 2 different COD_MOS_RSPS_TRN values. In the resulting dataset, I would want to keep the observation associated with FL5 since that would would be the 1st record after sorting: I attempted to accomplish this with the below code, but it removed far too many records (e.g. the example account above was completely removed from the dataset): data work.final_decision_nodups; set work.final_decision; by score_customer_account_xid transaction_dttm transaction_amt cod_mot_rsps_tran; if first.cod_mot_rsps_tran then; else output; run; Can anyone tell me what I'm doing incorrectly? I'm on SAS EG 7.1. Thanks!
... View more