pobel 发表于 2010-7-9 07:52 
data a;
retain c1 c2;
infile cards column=column;
Hi,pobel大侠,对您的程序加了几句代码,运行后变量M,M2,M3值是一样的,而跟M11,M12却不同,希望您能帮忙解释下,谢谢!
data a7;
retain c1 c2;
infile cards column=column;
M=column;
input test : $1. @;
M11=M; *add1;
M12=column; *add2;
if M>column then M=1;
M2=M; *add3;
if test="a" or test="c" then input @M c1 $ c2 $;
else input @M c3 c4 @@;
M3=M; *add4;
*if c3 ne .;
*keep c1-c4;
datalines;
a b
1 2 3 4
5 6 2 3
c d
1 3 4 5
;
run;
proc print data=a7;
run;