The line of code that is having an issue, is
Column( colNamesList[theColumn] || " PASS/Fail" ) << delete formula;
The error statement is saying that it can not find the column that is being referenced. The column being referenced should have been created in the statement just before.
dt << New Column( colNamesList[theColumn] || " PASS/Fail",
numeric,
CONTINUOUS,
FORMULA( If( __LSL__ <= __col__ <= __USL__, 1, 0 ) )
);
What is required for this statement to work, is that both an LSL and a USL exist for the column being referenced in the formula. I suspect this is the issue. I would check to make sure that both LSL and USL exist.
Concerning your question
"Also why do we use "__" in specs limits like LSL"
This is not a JMP requirement. In the Substitute() function, there is a requirement to have pairs of matching values that JMP is going to use for the substitution. I use the "__" before and after the matching values, just to make the code clear. I also give the name of the matching pair something meaningful. And in this case, the Substitution() function is substituting the LSL, the reference Col and the USL, and so by my convention, I use, __LSL__, __col__ and __USL__.
Jim