如何将粗略描述与指南数据集相匹配并提取sas中的ID

时间:2015-01-08 06:02:46

标签: sas

我有一张带有一些电子描述的excel表格。例如:moto g first gen xt8001等。

我有另一个包含Product和product_ID的数据集(指南列表)我希望将原始描述中的产品与指南列表相匹配,并提供最适合我描述的产品ID。

任何帮助表示赞赏。真的很新sas

示例:

指南列表

product_ID  Product Description                 make     model  year   variant
er345c      2012 xata xt 1 juicer handheld      xata     xt1    2012   handheld
gh454f      1991 corona 112 400W heater         corona   112    1991   heater
ty445g      1999 blizzard 200W trimmer          blizzard -      1999   trimmer
er367c      2014 xata xt 2 juicer handheld      xata     xt2    2014   handheld

和原始描述

xata掌上榨汁机

我希望输出如下:

description           match1     match2
xata handheld juicer  er367c     er345c

我们需要采用原始描述并将其与指南相匹配。 我已经尽可能地清理了数据。

1 个答案:

答案 0 :(得分:0)

根据粗略描述中您可以依赖的内容,您可以简化以下操作:

1)首先在粗略描述中取每个单词

2)然后使用like函数,看它是否按行

列在指南列表中

3)跟踪指南列表中每行匹配的单词数

4)选择最高计数的匹配