<< Name Selection In Column() is a message you can send to data table. This seems to only support strings for values though, so if you need numbers you have to use some other method
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Select Where(:Age < 14);
dt << Name Selection in Column(
Column Name("Younger"),
Selected("Yes"),
Unselected("No")
);
Here is other method if you wish to use numbers (similar idea could be used for other values, but you have to initialize empty list using Repeat() instead of J())
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Select Where(:Age < 14);
selrows = dt << Get Selected Rows;
vals = J(1, N Rows(dt), 0);
vals[selrows] = 1;
dt << New Column("Selection", Numeric, Nominal, Values(vals));
-Jarmo