1. Write and debug a SAS/IML program before you try to put it into a macro.
2. I'm guessing you want to store each value of SE into a column vector and then concatenate that vector as a new column for x:
proc iml;
use sashelp.class;
read all var _num_ into x[colname=varNames];
close;
COL = 3; BCOL=1; STD = 2; /* make up values */
N = nrow(x);
SE = j(N, 1, .); /* allocate vector for SE */
do row=1 to N;
Sum = ssq(colvec(x[row, COL]-x[row, BCOL]));
SE[row] = STD*(sqrt(6/7*Sum));
end;
*print SE;
/* if you want to add a new column to x, use concatenation */
newX = x || SE;
print newX[colname=(varNames || "SE")];