Hi, I have a base SAS 9.4 merge conundrum that is mystifying me. I have two datasets that connect on an 8-digit ID unique to each person in my data. My merge is one to many. When I try to merge these files by ID, SAS fails to find any matches and appends the two files. Both files are sorted on ID only. My data step, which has successfully merged different files that use the same key and come from the same source and were created using the same proc SQL code: data work.temp; set dataA(in=master) dataB(in=using); by clt_id; masteronly=master and not using; usingonly=using and not master; match=master=1 and using=1; run; I have checked both datasets, and the ID is a numeric of length 8 and format 11. in both files. I have visually inspected both files to doublecheck that at least one ID exists in both. And, to make it more baffling, SPSS is able to correctly match the exact same files on the ID. The only potential answer I could find online is decimal instability, but my IDs are 8 digit integers and as far as I can tell SAS is only storing them as such because the type is only length 8. So what could conceivably be causing this? Summary: Two files linked on 8-digit integer ID, one to many merge, same storage type for ID in both files, successfully merged using same code by same ID with other files, visually confirmed at least one match exists, and SPSS matches files successfully.
... View more