== Why is this an issue? The format used to write a record to a file should be cleared before each use. Otherwise stale data left in the format from previous records may be saved into the current record if it does not have data for all the fields in the format. === Noncompliant code example [source,rpg] ---- C IF X <> Y ... C ENDIF C WRITE RECFMT ---- [source,rpg] ---- /free if x <> y; ... endif; write recfmt; /end-free ---- === Compliant solution [source,rpg] ---- C CLEAR RECFMT C IF X <> Y ... C ENDIF C WRITE RECFMT ---- [source,rpg] ---- /free clear recfmt; if x <> y; ... endif; write recfmt; /end-free ---- ifdef::env-github,rspecator-view[] ''' == Implementation Specification (visible only on this page) === Message Clear "XXX" before using it. endif::env-github,rspecator-view[]