The JSL at:
http://support.sas.com/demosdownloads/downarea_t4.jsp?productID=109646
is rather old and (thankfully!) obsolete since we added the 'row state handler' (in JMP 10 I think). This has a variety of uses, and the code below shows how you might exploit it in this case.
// ian.cox@jmp.com: 03Nove2014
// Demo of how to link multiple child tables to a parent table using a row state handler
NamesDefaultToHere(1);
// Make some tables to use
dt1 = NewTable("Table 1",
NewColumn("ID", Numeric, Conntinuous, Values((1::10)`)),
NewColumn("Response", Numeric, Continuous, Formula(RandomNormal(0,1)))
);
dt2 = NewTable("Table 2",
NewColumn("ID", Numeric, Conntinuous, Formula(RandomInteger(1,5))),
NewColumn("Attribute 2", Numeric, Continuous, Formula(RandomInteger(0,10))),
AddRows(20)
);
dt3 = NewTable("Table 3",
NewColumn("ID", Numeric, Conntinuous, Formula(RandomInteger(1,11))),
NewColumn("Attribute 3", Numeric, Continuous, Formula(RandomInteger(0,100))),
AddRows(30)
);
// Utility function:
// Given a data table, a column therein and some value(s) in that column, selects all corresponding rows.
// Need to allow for 'col' to be numeric (character), in which case 'vals' is a matrix (is a list).
selectMatchingRows =
Function({dt, col, vals},
rows2select = [];
if (IsMatrix(vals),
// 'col' is numeric
For (i=1, i<=NRow(vals), i++,
rows2select = VConcat(rows2select, dt << GetRowsWhere(col == vals[i]));
)
,
// 'col' is character
For (i=1, i<=NItems(vals), i++,
rows2select = VConcat(rows2select, dt << GetRowsWhere(col == vals[i]));
)
);
dt << SelectRows(rows2select);
);
// Make a row state handler to be assigned to the 'master' table (dt1). Allow for multiple row selections.
propagateSelectionToOtherTables =
Function({x},
// Get the rows that have been selected
selectedRows = dt1 << GetSelectedRows;
If(NRow(selectedRows) > 0,
// Get the corresponding IDs
IDs = dt1:ID[selectedRows];
// Select the corresponding rows in dt2
selectMatchingRows(dt2, Expr(:ID), IDs);
// Select the corresponding rows in dt3
selectMatchingRows(dt3, Expr(:ID), IDs);
,
// Clear any existing selection
dt2 << ClearSelect;
dt3 << ClearSelect;
);
);
// Assign the handler to dt1
rsh = dt1 << MakeRowStateHandler(propagateSelectionToOtherTables);