User Guide : Using Content Extraction Language : Pattern Matching and Action Statements : CXL Patterns
 
Share this page             
CXL Patterns
The CXL patterns control the execution of action statements. When a pattern is matched, its associated action statements are executed.
BEGIN { statements }
The BEGIN pattern is not tested against the input. Instead, the BEGIN statements are executed before any of the input is read. It provides a way to initialize before processing the input. BEGIN patterns cannot be combined with other patterns in pattern expressions and cannot have missing action parts. Only one BEGIN pattern is supported. If there is more than one BEGIN, the action parts of the last BEGIN pattern is executed.
END { statements }
The END pattern is also not tested against the input. Instead, the END statements are executed when all the input is exhausted. It provides a way to wrap-up after processing the input. END patterns cannot be combined with other patterns in pattern expressions and cannot have missing action parts. Only one END pattern is supported. If there is more than one END, the action parts of the last END pattern will be executed.
CATCHUP { statements }
The CATCHUP pattern is not tested against the input. It is only matched when the CATCHUP ON statement has been executed. The CATCHUP pattern-action block is used for accumulating multiple records for output at a later time. The CATCHUP OFF statement must be executed to terminate processing the CATCHUP pattern-action block. CATCHUP patterns cannot be combined with other patterns in pattern expressions.