There may be situations where you need to consider in what order the various components of a FIELD statement are processed. Mostly they are done in the order in which they appear, but there are exceptions. So, here is the order of execution:
-
Any IF condition is tested. If this tests false and an ELSE_SKIP exists, then the ELSE_SKIP is processed. Otherwise, the rest of the steps are skipped.
-
Any StartBit method is called.
-
The Size Method is invoked to determine the size of the field.
-
If the field size is 64 bits or less, then the value is extracted.
-
If the field size is 64 bits or less, any Retrieve Clause is processed to massage the value.
-
If the field size is 64 bits or less, any Store Clause is processed.
-
Any PRINT_IF condition is tested and if it proves false, the next 2 steps are skipped.
-
If an IN_SUMMARY is included, the value is formatted for the Summary Pane.
-
The value is formatted for the Decode Pane unless the keyword SUPPRESS_DETAIL is present.
-
Any Verify Method is called. If the VERIFY is part of a PRINT_IF, the PRINT_IF is then processed.
-
Any NO_MOVE is processed.
One item of interest that becomes clear from this list is that an IF clause cannot test the value or size of the current field.