Subset() creates a new data table from rows that you specify. If you specify no rows, Subset uses the selected rows. If no rows are selected or specified, it uses all rows. If no columns are selected or specified, it uses all columns. And if Subset has no arguments, the Subset window appears.
dt << Subset(
	Columns( columns ),
	Rows( row matrix ),
	Linked,
	Output Table Name( "name" ),
	Copy Formula( 1 or 0 ),
	Sampling rate( n ),
	Suppress Formula Evaluation( 1 or 0 ) );
For example, using Big Class.jmp, to select the columns for all rows in which the age is 12:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
For Each Row( Selected( Row State() ) = (:age == 12) );
subdt = dt << Subset( Output Table Name( "Subset" ) );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
subDt1 = dt << Subset(
	Columns( :name, :age, :height ),
	Output Table Name( "Big Class 2" )
);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
subDt2 = dt << Subset(
	Columns( :name, :weight ),
	Rows( [2, 4, 6, 8] ),
	Linked
);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 12 );
dt << Subset( ( Selected Rows ), Output Table Name( "Subset" ) );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 12 );
If( N Rows( dt << Get Selected Rows ) == 0,
/* If the condition selected no rows, open Fitness.jmp.
   Else, generate the desired subset table of Big Class.jmp.
*/
   newdt = Open( "$SAMPLE_DATA/Fitness.jmp" ),
   newdt = dt << Subset( All Columns( 1 ), Selected Rows( 1 ) )
);

Help created on 7/12/2018