ziyenano 发表于 2012-11-16 09:38 
是不是这个意思?
data def;
input
There are a couple of knowledge points here.
1) the call symput is obsolete. call symputx should be used whenever possible. call symputx converts values automatically.
2) using cat class function to do the concatenation for the same reason.
193 data def;
194 length Variable $8 P_value 8;
195 input
196 Variable P_value;
197 call symputx( catt('P',Variable), P_value);
198 cards;
NOTE: The data set WORK.DEF has 10 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
209 ;
210
211 %put &Pv1 &Pv2 &Pv3 &Pv4 &Pv5 &Pv6 &Pv7 &Pv8 &Pv9 &Pv10;
0.64 0.08 0.06 0.04 0.01 0.01 0.01 0.01 0.01 0.01