Bryan, you have got me stumped. I set up a test. Flat file to HL7 2.1 DG1.1 field 506 (SI length 4) with that code and it worked perfectly. Are you in a position where you could do a reboot and clear memory? I don’t have a clue as to why that wouldn’t work even though we are on different versions.
Here was my setup for the test
copy =3 -> 0(0).DG1.00506
with the code I gave you above in the pre tcl area.