BookmarkSubscribeRSS Feed
nrk1787db1
Obsidian | Level 7

I have two variables named MNEMONIC and Details. I need to compare values in these variables and find out if replacing Mnemonic with Details creates value.

 

I'm using COMPGED to compare these variables as below

 

GED_SCORE = COMPGED(UPCASE(STRIP(COMPRESS(MNEMONIC,' :_/\-'))) ,
                    UPCASE(STRIP(COMPRESS(DETAILS,' :_/\-')))) ;

 

And have written few conditions to remove records which doesnt fetch me any value if I replace MNEMONIC with Details

 

IF GED_SCORE = 0 THEN DELETE ;

 

IF GED_SCORE < 35 THEN DELETE ;

 

Could anyone please suggest better way of doing this ?

 

Sample Dataset: { Edited }

 

Mnemonic               Details
ABC:Test_Admin      All Britain Corp Test Admin User
ESPC                        East Special Port Center
Memo                      Memo by post
Green_Card_holder  Green Card Holder

 

Replacing Mnemonic with Details for 1st and 2nd records create high value ;  For 3rd value provided is average and for last replace doesn't provide any value as it is the same words replaced by special characters.

 

There are about 2 millions of records and just for performance reasons I don't want to replace all of them. Hope this helps.

 

{ Edited }

 

Main reason for doing this fuzzy_logic is to save space.

4 REPLIES 4
art297
Opal | Level 21

It would help if you provided an example dataset.

 

Art, CEO, AnalystFinder.com

 

nrk1787db1
Obsidian | Level 7

Thank you for your response, Tried giving a small 5 records dataset as example.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Not sure what we can suggest, you haven't told us anything other than you have that line of code.  If it works then good.  I can certainly suggest not coding all in uppercase as it makes it virtually unreadable.

art297
Opal | Level 21

What are you trying to accomplish? Are you trying to save space, combine similar "details", or something else?

 

Art, CEO, AnalystFinder.com

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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