000-349 · Question #7
An application developer has a file which consists of fixed length records. The first record is a header record followed by some number of detail records. The number of detail records is expressed…
The correct answer is C. Use a component rule to compare the current record to the value found in the header. In WTX, a component rule attached to the detail record type can reference the count value from the header record to dynamically control how many occurrences the parser consumes.
Question
An application developer has a file which consists of fixed length records. The first record is a header record followed by some number of detail records. The number of detail records is expressed by a value found in the header record. How does the developer define this type of data in WebSphere Transformation Extender?
Options
- AUse a Map function to keep track of how many detail records there are
- BWrite a custom function to store the number of detail records in the map context
- CUse a component rule to compare the current record to the value found in the header.
- DIndex the input based on the count in the header record
How the community answered
(40 responses)- A18% (7)
- B8% (3)
- C70% (28)
- D5% (2)
Why each option
In WTX, a component rule attached to the detail record type can reference the count value from the header record to dynamically control how many occurrences the parser consumes.
Map functions operate on data during transformation output, not during type tree parsing, and cannot be used to define the structural occurrence count of detail records.
Custom functions can extend map logic but cannot define the structural parsing rules within a type tree that determine how many occurrences of a component are consumed.
WTX component rules allow a developer to attach a logical condition or count expression directly to a type tree component, controlling how many occurrences are recognized during parsing. By writing a component rule that reads the count field from the already-parsed header record and compares it against the current occurrence index, the parser correctly limits detail record consumption to the number specified in the header.
Indexing provides a mechanism to access a specific occurrence of a component but does not define or constrain the total number of detail records parsed based on a value found in the header.
Concept tested: WTX component rule for header-driven dynamic record occurrence
Source: https://www.ibm.com/docs/en/wtx
Topics
Community Discussion
No community discussion yet for this question.