Hi,
I am trying to get the percentage using the levenshtein function, but the code is not working in SAS.
(x1-x2)/x1
(maX(length(stringa), length(stringb)) - levenshtein(stringa, stringb))) /
max(length(stringa),length(stringb)) as lev_perc
PS: I need to run the program in EAP hive using SAS, so i need to use the function that is compatible to hive too.
Thanks for checking
Maybe you want the COMPGED function, which is the Levenshtein distance in SAS.
It think that should be COMPLEV function if you want the specific Levenshtein distance.
Thanks, I have tried both functions and not working.
COMPGED(stringa, stringb) AS VALUE1,
COMPLEV(stringa, stringb) AS VALUE2,
ERROR: Prepare error: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:53 Invalid
function 'COMPGED'
ERROR: Prepare error: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:53 Invalid
function 'COMPLEV'
May be its not working in Hive EAP
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.