data tshirt; input @1 id $5. @7 cloth $6. @14 receipt_number $3. @18 date mmddyy10.; format date mmddyy10. ; datalines; 12345 tshirt 22x 08/23/2018 12345 tshirt 23x 08/23/2018 12345 tshirt 24x 09/24/2018 12345 tshirt 25x 09/24/2018 12346 tshirt 22y 08/23/2018 12346 tshirt 23y 08/24/2018 12347 tshirt 25z 09/25/2018 ; run; data others; input @1 id $5. @7 cloth $6. @14 receipt_number $3. @18 date mmddyy10.; format date mmddyy10. ; datalines; 12345 perfum 23x 08/23/2018 12345 perfum 24x 08/23/2018 12347 perfum 25z 09/25/2018 12347 cologn 26z 09/25/2018 ; run; *Question: who bought shirts and other stuff from 'others' data set on the same date?; proc sql; create table common as select A.*, B.* from tshirt A, others B where A.ID = B.ID and A.date=B.date; quit; I am not getting what I want. Please help.
... View more