t**********r 发帖数: 182 | 1 Variable name is Title and has the following indications. I want to identify
a person who is both chairman and CEO. - I want to create a dummy CEO_chair
. How can I do this? thanks.
================================
chairman &CEO
chairman of the executive committee
chairman president & CEO
chairman& CEO
chairman, & CEO
chairman, CEO
chairman, CEO & chief creative officer
chairman, CEO & president
chairman, president & CEO
chairman, president & CEO
chmn & CEO
chmn, & CEO
chmn, emeritus
chmn, pres | P****D 发帖数: 11146 | | P****D 发帖数: 11146 | 3 data Y;
set X; /* assuming your original dataset is X */
findchmn=indexw(position, 'chairman', 'chmn'); /* assuming that variable
name is position */
findceo=indexw(position, 'CEO');
if (findchmn~=0) and (findceo~=0) then CEO_chair=1; else CEO_chair=0;
run;
注意第一个indexw函数里的最后一个参数'chmn'是假设chmn是chairman的简称。如果还有更多简称,也要加在indexw函数里面。请自行Google学习indexw。 | t**********r 发帖数: 182 | |
|