Here is a working piece of code that I believe may be close to what you want......I am making the assumption you what the actual data from the selected rows, and not the row numbers.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
// Change the column name "name" to "subject"" to match the example
dt:name << set name( "subject" );
cohort = {"C", "J", "S"};
dt << Select Where( Starts With( :subject, cohort[1] ) );
baseDT = dt << Subset( output table name( "Test" ), selected rows( 1 ), selected columns( 0 ) );
For( i = 2, i <= N Items( cohort ), i++,
dt << Select Where( Starts With( :subject, cohort ) );
TempDT = dt << Subset( output table name( "Test" ), selected rows( 1 ), selected columns( 0 ) );
baseDT = baseDT << concatenate( TempDT, append to first table( 1 ) );
Close( TempDT, nosave );
);
freezerlist = baseDT:subject<<get values;
show(freezerlist);
Jim