I am trying to apply the log10 function to an entire column within a data table. The result will be in a new column with a new name. The new column and name are generated by I get an error in the formula portion. Below are the results of the script and the error message.


This is the script:
Names Default To Here(1);
dt = as table(J(5,5,randomuniform()), << column names({"X1","X2", "X3", "X4", "X5"}));
ColNames = dt << Get Column Names( String );
For(i = 1, i <= N Items(ColNames), i++,
// Get name of column to work
ex2=(ColNames[i]);
//place prefix on column name
ex="Ln_";
//concatenate prefix and column name
ex3=ex || (char(ex2));
//Create new column and put results on log of original column in new column
dt << new column (ex3, "Numeric", formula(Ln(:ex2)));
);
Thanks for your help in advance.
Ray