The primary issue you are having is that within the definition of a formula, one can not have items that need to be evaluated. JMP thinks everything within the formula definition is to be evaluated only when the formula is executed.
Therefore, the formula that is passed into the New Column definition, must be complete in it's syntax. The modification of your code below works with your sample data table.
Names Default To Here( 1 );
dt = Current Data Table();
row = Associative Array( :test_article ) << Get Keys;
nc = N Items( row );
For( i = 1, i <= nc, i++,
Eval(
Parse(
"New Column( \!"PBS vs " || row[i] ||
"\!",
Character,
Nominal,
Formula(
if (Row() == 1, theTest = \!""
|| row[i] ||
"\!");
If( :test_article == \!"PBS\!",
zip=:test_article,
If( :test_article == theTest,
zip=\!"test\!",
zip=\!"EXCLUDE\!"
)
);
zip
)
)
);"
)
)
);
Jim