|
|
Re: 新药统计中定量指标的SAS宏程序
我没说本版没贴出不少的程序啊?怎么扯到那里去了?能看到这样的版块我很高兴的啊!不过您作为版主总该有点魄力吧!我知道在国外这些资料早已经不是密码了。我看过一个网站,里面关于这方面的资料都是公开的,只是那个库太大,我暂时没有去找我要的东西就发现这个中文论坛了,本来以为我的那个问题可对于你们这些高手是小CASE,可以在这里得到解决的,那collen版主已经说了这对于你是个秘密,我也就不强求什么了!不过还是希望能把这个版块办的越办越好!顺便送个宏给大家
%macro verify(text,ref);
%local pos error;
%let error=0;
%if not %length(&text) %then %do;
%put ERROR: (verify) No text string supplied for verify to act on.;
%let error=1;
%end;
%if not %length(&ref) %then %do;
%put ERROR: (verify) No reference string supplied for verify to use.;
%let error=1;
%end;
%if &error %then %goto error;
%do pos=1 %to %length(&text);
%if NOT %index(&ref,%qsubstr(&text,&pos,1)) %then %goto gotit;
%end;
%gotit:
%if &pos GT %length(&text) %then 0;
%else &pos;
%goto skip;
%error: %put ERROR: (verify) Leaving verify macro due to error(s) listed.;
%skip:
%mend;
Purpose : Function-style macro to return the position of the first character in a string that does not match any character in a reference string. |
|