Here's one way to do it. Basically you build a string and then execute it.
stack_expr = "\[Data Table( "temp" ) << Stack( columns(]\";
nc = 128; // Set for your table
for (i = 1, i <= nc, i++,
k = char(i);
stack_expr = stack_expr || evalinsert("\[ :Name( "ABC0(^k^)" ) ]\");
// Add the comma between columns, except for the last one
if (i < nc,
stack_expr = stack_expr || ", ";
);
);
stack_expr = stack_expr ||
"\[Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
output table("npt"))]\";
eval(parse(stack_expr));