Update:
it looks like it was fixed in later release of M6 (while I was running in earlier release). And it is fixed in 9.4 M7.
I recommend you open a TS track for this question.
Please include the following:
- Title "KCOMPARE returns error "The KCOMPARE function call has too many arguments" when 5 arguments are supplied
- SAS Version you are running (the following code will report SAS version information)
%put &sysvlong ;
%put &sysscpl ;
%put &syssite ;
- Registry Report (*.txt files) for each server, please clearly name the report files to reflect the server it was executed on.
- The code (as you have it here)
- The SAS Log
Are you running regular SAS code? Or are you using CAS/Viya?
Are you using DBCS?
Also this page seems to indicate the MODIFIER optional argument is not supported.
DBCS Compatibility
The DBCS equivalent function is KCOMPARE Function in SAS National Language Support (NLS): Reference Guide. There are minor differences between the COMPARE and KCOMPARE functions. Both functions accept varying numbers of arguments. Usage of the third argument is not compatible. This example shows the differences in the syntax.
COMPARE(string-1, string-2 <, modifier(s)>)KCOMPARE(string-1 <, position <, count> >, string-2)
It looks like the documentation is inconsistent.
Click on the feedback button on the documentation page, the team are really good at replying.
Update:
it looks like it was fixed in later release of M6 (while I was running in earlier release). And it is fixed in 9.4 M7.
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.