If your input fields are all numbers then you can use data step logic to do it without macro code. Create an array of the target variables and another with the expected length of each variable. Then loop over the arrays keeping your own pointer into the input buffer. You can adjust the length depending on whether the value starts with a minus sign. data out; array var f1-f6 ; array len (6) _temporary_ (6*4) ; input @; col=1; do _n_ = 1 to dim(var); neg=substr(_infile_,col,1)='-'; var(_n_)=input(substr(_infile_,col,len(_n_)+neg),best.); col+len(_n_)+neg; end; drop col neg ; put (var(*)) (best6.); cards; 0.1 0.2 0.3 0.4 0.5 0.6 OK 0.110.220.330.440.550.66 OK 0.11-0.220.330.440.550.66 f2 shifts by 1 0.11-0.220.33-0.440.550.66 f2, f4 each adds 1 0.11-0.22-0.33-0.44-0.55-0.66 f2, f3, f4, f5, f6 all adds 1 -0.11-0.22-0.33-0.44-0.55-0.66 everything is wider by 1 -0.11-0.220.33-0.440.55-0.66 ; 0.1 0.2 0.3 0.4 0.5 0.6 0.11 0.22 0.33 0.44 0.55 0.66 0.11 -0.22 0.33 0.44 0.55 0.66 0.11 -0.22 0.33 -0.44 0.55 0.66 0.11 -0.22 -0.33 -0.44 -0.55 -0.66 -0.11 -0.22 -0.33 -0.44 -0.55 -0.66 -0.11 -0.22 0.33 -0.44 0.55 -0.66
... View more