000-349 · Question #45
An application developer needs to split a file consisting of 10 records into 10 output files each with one record. The file name of the output files must contain the record number from the input…
The correct answer is A. INDEX and RUN. Splitting a multi-record input file into individually named output files in a WTX/Sterling map requires INDEX to retrieve the current record number for use in the filename, and RUN to execute a functional map that produces each separate output file per record.
Question
An application developer needs to split a file consisting of 10 records into 10 output files each with one record. The file name of the output files must contain the record number from the input file. What two functions can be used in this map to achieve this task?
Options
- AINDEX and RUN
- BCHOOSE and PUT
- CINDEX and SETFILENAME
- DCOUNT and CREATEFILE
How the community answered
(30 responses)- A73% (22)
- B17% (5)
- C7% (2)
- D3% (1)
Why each option
Splitting a multi-record input file into individually named output files in a WTX/Sterling map requires INDEX to retrieve the current record number for use in the filename, and RUN to execute a functional map that produces each separate output file per record.
INDEX returns the occurrence number of the object currently being processed in the map loop, providing the record number that can be embedded in the output filename. RUN executes a functional map for each record iteration, which handles the creation and naming of each individual output file, together satisfying both the splitting and dynamic-naming requirements.
CHOOSE selects a value based on a conditional test and PUT writes data to an output location, but neither provides the per-record occurrence number needed to dynamically name 10 separate output files.
SETFILENAME is not a valid standard function in the WTX/Sterling map function library, so pairing it with INDEX cannot produce the required output even though INDEX alone correctly supplies the record number.
COUNT returns the total number of occurrences of an object and CREATEFILE is not a recognized WTX map function, so this pair cannot perform the iterative file-splitting and dynamic naming required.
Concept tested: INDEX and RUN functions for iterative file splitting
Source: https://www.ibm.com/docs/en/b2b-integrator/6.1?topic=functions-index
Topics
Community Discussion
No community discussion yet for this question.