HOW to translate this logic into DECODE

Original text of this message