A question about using sets of column names. You can use JSL's associative arrays to perform set operations. The methods <<Intersect, <<Remove, and <<Insert do the work.
rgb = associativearray({"red","green","blue"});
cmy = associativearray({"cyan","magenta","yellow"});
bw = associativearray({"black","white"});
all = rgb;
all<<insert(cmy);
all<<insert(bw);
show(all<<getkeys);
two = associativearray({"magenta","red"});
all<<remove(two);
show(all<<getkeys);
rainbow = associativearray({"orange","cyan","green","red","blue"});
all<<intersect(rainbow);
show(all<<getkeys);
The question was posed in terms of sets of column names, and this example uses the associative array set operation <<remove to get the difference between the set of all columns and the set of columns containing the letter "i".
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
allnames = dt << getcolumnnames( "string" );
inames = {};
For( i = 1, i <= N Items( allnames ), i++,
If( Contains( allnames[i], "i" ),
Insert Into( inames, allnames[i] )
)
);
allset = Associative Array( allnames );
iset = Associative Array( inames );
allset << Remove( iset );
notinames = allset<<getkeys;
For( i = 1, i <= N Items( notinames ), i++,
dt:(notinames[i]) << Set Selected( 1 )
);
dt << Delete Columns();