The log file entry from when your code is run is:
not enough arguments in access or evaluation of 'For' , For/*###*/(i = 1 ; N Rows( dt ) ; i++, Column( dtOffset )[i] = dt:colList[i]
+dtOffset:Offset[i])
at line 7 in Script 5.jsl
What this is telling you, is that the For() function syntax that you are using is incorrect.
The correct definition can be found in the Scripting Index, or in the Scripting Guide. Also, if you look at your implementation of the For() function, and the sample I provided, your version is not the same.
Your solution is going to require that you loop across the columns in your Table A. For each column you will need to get the Offset value that needs to be applied to the values in the Table A column, and then loop through all of the rows in that column, applying the correct offset.
Names Default To Here( 1 );
dt = Data Table( "Table A" );
dtOffset = Data Table( "Table B" );
colList = dt << get column names(string);
For( i = 1, i <= N Items( colList ), i++,
// Find the offset value in the dtOffset(Table B) data table
// Because the column name from Table A may not have an offset
// in Table B that has to be accounted for
theRow = dtOffset << get rows where( dtOffset:Tests == colList[i] );
show(i,nrows(therow));
// If no rows are returned, no offset was found
If( N Rows( theRow ) == 1,
offset = dtOffset:Offset[theRow[1]];
For( k = 1, k <= N Rows( dt ), k++,
Column( dt, i )[k] = Column( dt, i )[k] + offset
);
);
Jim