- data _null_;
- if _N_ = 1 then
- do;
- retain patternID;
- pattern = "/(\d+):(\d\d)(?:\.(\d+))?/";
- patternID = prxparse(pattern);
- end;
-
- array match[3] $ 8;
- input minsec $80.;
- position = prxmatch(patternID, minsec);
- if position ^= 0 then
- do;
- do i = 1 to prxparen(patternID);
- call prxposn(patternID, i, start, length);
- if start ^= 0 then
- match[i] = substr(minsec, start, length);
- end;
- put match[1] "minutes, " match[2] "seconds" @;
- if ^missing(match[3]) then
- put ", " match[3] "milliseconds";
- end;
- datalines;
- 14:56.456
- 45:32
- ;
想请问下大家这里面的 if _N_ = 1 有什么作用吗?似乎删掉了对程序结果也没有什么影响啊?



雷达卡



京公网安备 11010802022788号







