Page 1 of 1

BuildOp Stage

Posted: Sun Oct 19, 2008 8:39 am
by Luciana
Hi,

I have a simple BuildOp Stage that multiply two columns. This job execute fine but the output is not correct. In Sequential File there are three columns, the Amount is correct, but the another columns receive "0". These columns must pass without changes. I don't understand where is the error. Somebody can help me?

Row Generator ---> BuildOp Stage ---> Sequential File

Input
========
Qty
Price
Tax_Rate

Output
==========
Amount
Qty
Tax_Rate

Configurations:

BuildOp - Properties
=================
Exchange

BuildOp - Build
=================
Input: InRec - Auto Read: True - Table name: Saved\tmp\input - RCP: False
Output: OutRec - Auto Write: True - Table name: Saved\tmp\output - RCP: False

BuildOp - Logic in Per-Record
======================
Amount = InRec.Qty * InRec.Tax_Rate;
Amount = Amount * Exchange;

Thank you in advance

Luciana

Posted: Sun Oct 19, 2008 10:26 am
by Nagaraj
Cant you do this in a transformer?

Posted: Sun Oct 19, 2008 10:59 am
by Luciana
Yes, I can, but I have a DataStage Job that the transformer is very slow then I want replace the transformer stage for a buildOp stage, but neither all columns have transformation, then I make this simple BuildOp Stage for test.

Thank you,
Luciana

Posted: Sun Oct 19, 2008 2:14 pm
by marcelo_almeida
Include in your code (Per-Record) the columns that don't have transformation.

ex.: OutRec.Qty = InRec.Qty;

Posted: Sun Oct 19, 2008 3:20 pm
by ray.wurlod
Why do you think that a Build stage that performs exactly the same task as a Transformer stage would run at any different speed?

Posted: Sun Oct 19, 2008 8:01 pm
by Luciana
I don't know if it will be faster, but it was a recommendation of a consultant IBM.

I include the other columns in the code and the job it executed with success.

Thanks a lot.

Luciana

Posted: Sun Oct 19, 2008 8:14 pm
by ray.wurlod
Please compare your BuildOp code with the code generated by compiling the Transformer stage. Did you do anything differently?

Posted: Mon Oct 20, 2008 3:02 pm
by ray.wurlod
Code for the Transformer stage is in the RT_SCnnn directory on the server, where nnn is the job number.