I'm trying to figure out how to use a user specified list to select those data columns contained in the list. The user supplied list may contain more or less names than present in data table. For example, I've tried the following but I can't seem to get it to work. Any ideas would be appreciated. Thanks
dt = open("$SAMPLE_DATA/Big Class.jmp");
// Get list of data column names
col_list = dt << Get Column Names ( String );
// User specified column names
cc = { sex, weight, test, new, old };
for( i=1, i<=ncol( cc ), i++,
if(contains( col_list, cc ),
Column ( dt, col_list ) << Set Selected ( 1 )
)
);