How your code is executed (DataStage)

Details of how the code that you define when you specify a Build stage executes when the stage is run in an IBM® DataStage® job.

About this task

The sequence is as follows:

Procedure

  1. Handles any definitions that you specified in the Definitions sub-tab when you entered the stage details.
  2. Executes any code that was entered in the Pre-Loop sub-tab.
  3. Loops repeatedly until either all inputs have run out of records, or the Per-Record code has explicitly invoked endLoop(). In the loop, performs the following steps:
    1. Reads one record for each input, except where any of the following is true:
    2. The input has no more records left.
    3. The input has Auto Read set to false.
    4. The holdRecord() macro was called for the input last time around the loop.
    5. Executes the Per-Record code, which can explicitly read and write records, perform transfers, and invoke loop-control macros such as endLoop().
    6. Performs each specified transfer, except where any of the following is true:
    7. The input of the transfer has no more records.
    8. The transfer has Auto Transfer set to False.
    9. The discardTransfer() macro was called for the transfer during the current loop iteration.
    10. Writes one record for each output, except where any of the following is true:
    11. The output has Auto Write set to false.
    12. The discardRecord() macro was called for the output during the current loop iteration.
  4. If you have specified code in the Post-loop sub-tab, executes it.
  5. Returns a status, which is written to the IBM DataStage Job Log.