Enrichment Language vs. Procedural Languages
The Enrichment language is unlike traditional procedural languages like COBOL or RPG. While the coding of an Enrichment object is similar to a declaration in a procedural language, in Enrichment the object is automatically processed when it is defined. Conversely, in a procedural language you would have to call functions or write code to read the input and find the data items on each page, because the declaration itself does not cause an action to occur. By design, Enrichment reads the print stream, finds pages, finds documents, and collects data from the document as a direct response to the definition of the <INPUT> object in the control file. This can save a lot of programming time and can result in much more reusable and maintainable code.
Note that the code you create in a rule file is procedural. However, these procedures are in effect acting upon the objects and processes established in the control file. For example, the DOCUMENT: section of the rule file operates on each of the documents read from the print stream. By simply redefining the value of a variable in the rule file, you can change the appearance of the document. You do not have to actually write code to place the variable on the document.