I have a complex database that I am building for work. It requires me to join several data sources that come in either .csv or .txt files. The .txt files are nicely formatted with .sas files that help you pull them into tables. The .csv files are poorly formatted and require some pre-formatting with excel to remove extraneous lines. There is a common unique variable "a combination of text, numbers, and symbols" that each data set shares. It would look something like 'B3245_010_2' without the quotes. I am using this to perform all of the joins for my main table. Every file that comes from a .txt file joins appropriately. The data that comes from the .csv file acts as if there are no matching variables when I attempt to left join in SAS EG, and I get null results for each of those values. I have confirmed that the variables are of the same data type and the same length. Furthermore, when I run the exact same code using PC SAS, the correct values show up in my results. I've been tearing my hair out over this, and I am curious if this is a known issue. I am working on a Windows 10 computer. My SAS EG version is 7.15 (64-bit), and my PC SAS version is 9.4 (64-bit). I do PC File Server installed on my computer, and it does not run on the server to my knowledge. This is the only thing I can think of, but I wouldn't expect this to affect csv files. Also, the data looks exactly the same. I attempted to run the datastep macro to get real data, but the connection was refused. This is probably due to IT restrictions. An example of a simple join is shown below. In my example, Total_Cost would show up as all blank despite the fact that Total_Cost and Max_Payment each have IDs that match. If I were to run this as a Right join keeping everything else the same, Total_Cost would shop up, but the other columns would be blank. proc sql;
Create Table Test as
Select Distinct main.ID, LS.Total_Cost, main.Max_Payment
From Main
left join LS
on Main.ID=LS.ID
Order by ID
;
quit;
... View more