Designing a Sequential Producer Operator - Parallel Transporter

Teradata Parallel Transporter Operator Programmer Guide

Product
Parallel Transporter
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2018-10-10
dita:mapPath
vxb1527114222350.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2435
lifecycle
previous
Product Category
Teradata Tools and Utilities

Use the following process guidelines for implementing the Initiate, Execute, and Terminate functions for a sequential producer operator.

Implementing a Sequential Producer Operator
Function Process
Initiate
  1. Use the Get Attribute function to get the path name of the sequential file.
  2. Use the path name to open the file and get the file handle.
  3. Use the Allocate Storage function to allocate a user area.
  4. Save the file handle in the user area.
  5. Use the Allocate Storage function to allocate a data buffer area big enough to hold the maximum size of a row in the sequential file.
  6. Save the data buffer address and the buffer length in the user area.
  7. Use the Put Attribute function to save the user area.
Execute
  1. Get the output table handle.
  2. Use the Get Attribute function to get the user area.
  3. Get the file handle and the data buffer address from the user area.
  4. Use the file handle to read the next row into the data buffer.
  5. Use the Get Table Schema List function to get the output data schema.
  6. If the read is successful, use the Put Row function to write the row to the output data stream and return the PXSTC_SamePhase status.
  7. If the read/write is not successful, return bad status.
  8. If end-of-file is encountered, return either PXSTC_EndOfData or PXSTC_EndMethod status.
Terminate
  1. Use the Get Attribute function to get the user area.
  2. Get the file handle from the user area.
  3. Use the file handle to close the sequential file.
  4. Use the Free Storage function to free the data buffer.
  5. Use the Free Storage function to free the user area.