BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Smile1
Calcite | Level 5

Hi~

 

To match COMPGED scores to 100 or less, I used compged function as below.

 

==========================================

libname proj "D:\SASWORK";
proc sql; *evaluate name similarity with score 0~100;
create table nameexample
as select *, compged (lender, mgrname) as similarity
from proj.periodexample
where calculated similarity le 100;
quit;

==========================================

 

There is no problem from line 1 to 5.

However, when I add 'where calculated similarity le 100;', I can't get the result.

The log message is as follows : 

 

=========================================================

Note : Table WORK.NAMEEXAMPLE created, with 0 rows and 11 columns.

=========================================================

 

I would really appreciate it if anyone could give me a help.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @Smile1 ,

 

I guess you do not have any COMPGED costs below (ore equal to) 100.

Please check for minimal 'similarity' value after running your PROC SQL without the where clause.

 

Or maybe you need some COMPGED modifiers (to ignore case, to remove blanks, to remove quotation marks during / before comparison).

 

If there are WARNINGs or ERRORs in your LOG, please publish your LOG in this thread.
Make use of the Insert Code icon </> in the toolbar and paste your LOG in the pop-up window. That way the LOG preserves structure and formatting (and some colors).

 

Thanks,

Koen

View solution in original post

4 REPLIES 4
sbxkoenk
SAS Super FREQ

Hello @Smile1 ,

 

I guess you do not have any COMPGED costs below (ore equal to) 100.

Please check for minimal 'similarity' value after running your PROC SQL without the where clause.

 

Or maybe you need some COMPGED modifiers (to ignore case, to remove blanks, to remove quotation marks during / before comparison).

 

If there are WARNINGs or ERRORs in your LOG, please publish your LOG in this thread.
Make use of the Insert Code icon </> in the toolbar and paste your LOG in the pop-up window. That way the LOG preserves structure and formatting (and some colors).

 

Thanks,

Koen

Smile1
Calcite | Level 5
Hi Koen,

Thank you so much for your help! I added modifier 'I' as you advised.
I coded as below and my sas program was finally working. Thank you so much! 🙂

==========================================
libname proj "D:\SASWORK";
proc sql; *evaluate name similarity with score 0~100;
create table nameexample
as select *, compged (lender, mgrname, 'I') as similarity
from proj.periodexample
where calculated similarity le 100;
quit;
==========================================
PGStats
Opal | Level 21

Note: The main advantage of COMPGED is the ability to modify the costs of edit operations by calling CALL COMPCOST prior to calling the COMPGED function. But you can't do that in SQL... so you might be better using the COMPLEV function instead. It is faster and the results are easier to understand.

 

complev (lender, mgrname) le 2;

PG
Smile1
Calcite | Level 5
Thank you for your advice, PG. Now, my COMPGED function is working. I will try to use COMPLEV function as well sooner or later.

Thanks, have a wonderful day! 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 784 views
  • 0 likes
  • 3 in conversation