I am not sure exactly what all you need with your code, but here is a simple script that creates your required subsets and saves them to an Excel workbook. If you need to save the jmp tables as separate tables, in addition to the workbook, you can do that with a simple loop after the workbook is created.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
cNa = dt << get column names;
xF = {};
For( c = 2, c <= N Col( dt ), c++,
d2 = dt << Subset(
All rows,
columns( dt:name, Column( dt, c ) ),
output table( Char( cNa[c] ) )
);
Insert Into( xF, d2 << get name );
);
close( dt, nosave );
Create Excel Workbook( "c:\TheWorkBook.xlsx", Eval( xF ), Eval( xF ) );
Jim