你这个问题不太好处理,因为学校和学院名字长度不一样。
如果都是四个字的,比如"北京大学“,”XX学院“,可以用如下程序:
libname test1 "F:\test1";
run;
data test1;
set test1.test1;
if find(cv,'大学')^=0 then do;
college=substr((scan(cv,1,'大学')),length((scan(cv,1,'大学')))-3,4)||"大学";
end;
if find(cv,'学院')^=0 and find(cv,'大学')=0 then do;
college=substr((scan(cv,1,'学院')),length((scan(cv,1,'学院')))-3,4)||"学院";
end;
run;