Go back to the process that created a userid as numeric. This process is faulty and needs to be fixed.
As you have seen, the PROC step won't execute under these conditions. You would have to convert one or the other data set. However, you don't need to create a new data set. Instead, create a view and feed the view into PROC COMPARE. One possibility (converting from character to numeric in the first file):
data file1_numeric / view=file1_numeric;
set file1;
temp_id = input(userid, 8.);
temp_item = input(useritemid, 8.);
drop userid useritemid;
rename temp_id = userid;
rename temp_item = useritemid;
run;
Then run your PROC COMPARE with file1_numeric and file2.
Of course the best solution would be to user the same structure in both of your data sets originally. And the second best solution would be to permanently convert your current data sets so they use the same structure. But if you are looking for a third best solution, this would be a way to approach it.
You may run into other problems. For example, perhaps some of the IDs were made character because they couldn't be stored as numeric. Perhaps they contain letters. You would have to examine the log for cases where the INPUT function gives you a message about invalid data. When the INPUT function uses the 8. informat, it assumes that you have nothing longer than 8 digits. If you have longer values, using a longer length in the INPUT function.
Go back to the process that created a userid as numeric. This process is faulty and needs to be fixed.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.