My segment is not getting set with the new value though It goes into the if statement. Am I doing something wrong? ClassMethod Clone(pRequest As EnsLib.HL7.Message) As EnsLib.HL7.Message [ Final ]</p>

s cREQ = pRequest.%ConstructClone()

s DG1 = cREQ.FindSegment("DG1",.ind)</p>

While (ind2 '="")</p>

{
diag = DG1.GetValueAt(4.1)</p>

if diag = "0"
{
tmp = "No code"
rc=DG1.SetValueAt(tmp,4.1)
}</p>

}

DG1 = cREQ.FindSegment("DG1",.ind2)</p>

request = cREQ
Quit request</p>

}

</body></html>