Output columns with same name as input require special consideration.
For example, The expression "if(a)then(b)" does not work as expected in dmtcalc if two different columns are used in the comparison.
unix% dmtcalc in.fits out.fits "expr=if(pi>500)then(pi=-1)"
works as expected ("pi" used for both pieces of the conditional), but
unix% dmtcalc in.fits out.fits "expr=if(energy>5000)then(pi=-1)"
does not work. This is because the pi value in the expression is not always initialized to the input. Instead you must explicitly initialize it
unix% dmtcalc in.fits out.fits "expr=pi=pi;if(energy>5000)then(pi=-1)"