nerdexam
IBM

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.

Development

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)
  • A
    73% (22)
  • B
    17% (5)
  • C
    7% (2)
  • D
    3% (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.

AINDEX and RUNCorrect

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.

BCHOOSE and PUT

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.

CINDEX and SETFILENAME

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.

DCOUNT and CREATEFILE

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

#INDEX function#RUN function#file splitting#dynamic filenames

Community Discussion

No community discussion yet for this question.

Full 000-349 Practice