The problem is that your varnames don't conform to the normal array declaration syntax, (as in array X {*} x1-x7). And unless you can guarantee the physical order of the vars in the PDF, the double dash convention (array c {*} _C4_ -- _C29_) might not be an option:
This is a good case for a list generating macro, as in:
%macro array(prefix=%str(),suffix=%str(),from=1,to=1);
%do I=&from %to &to; &prefix.&I.&suffix %end;
%mend array;
options mprint;
data want;
set have;
array c {} %array(prefix=_c,from=4,to=29,suffix=_);
array mp {} %array(prefix=y,from=2003,to=2015,suffix=mp);
array ms {} %array(prefix=y,from=2003,to=2015,suffix=ms);
do I=1 to 13;
if c{2*I-1}^= -999 then mp{I}=c{2*I-1};
if c{2*I}^= -999 then ms{I}=c{2*I};
end;
run;
Note if FROM has fewer digits than TO (i.e. from=80, to=120), Iand you really want something like three digits throughout ( X080P ...X120P), you can use the %array macro twice, as in
Array myvars {*} %array(prefix=X0,from=80,to=99,suffix=P) %array(prefix=X,from=100,to=120,suffix=P) ;
... View more