Ok - now i got your idea: You want to copy the column with the max value to a new sheet...
Instead of the part:
win -a TARGETBOOK; // activate output sheet
wcol(TARGETCOLUMN)=d01; // write dataset to column
use
dataset d02; // second temporary dataset
vfind ix:=d01 v:=max(d01) ox:=d02; // gives index to the column with the maximum value
i01=d02[1]; // get only first one
range r01=[IMPORTBOOK]$(i01)!SOURCE;
range r02=[TARGETBOOK]INDEXTARGETSHEET!INDEXTARGETCOLUMN;
r02=r01; // copy column