Custom Build Stage Issues. I get warnings

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nnes
Participant
Posts: 14
Joined: Mon Sep 12, 2005 1:10 pm

Custom Build Stage Issues. I get warnings

Post by nnes »

Job:
Sequential File -> Custom Stage -> Sequential File

I created a minimal custom build stage. I use the same table definition for input and output interfaces in the stage and also in the input and output links for the stage in the job. I set autoread, autowrite and autotransfer to true assuming I would have something similar to a Copy stage. There are no properties and no logic defined. Runtime column propagation is set to false for input and output (also for the project in the administrator). Unfortunately nothing gets transferred to the output link (everything in the output is blank). Additionally I get these warnings for each of the fields of the table:

Custom1_16: When checking operator: Dropping component "C_NO" because of a prior component with the same name.

I get one warning for each of the fields defined in the table definition.

Questions:
1) can anybody give me insight of why I get that warning?
2) how do I transfer the data from the input to the output without having to assign each column manually in the logic and without using runtime column propagation? Or "what is that transfer tab good for anyway if you have to use RCP?"

Thanks,
Nestr
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

For question 1, the warnings per column are because you are using autotransfer AND have specified an output schema. You need to use one or the other.

For question 2, check out the following posting: viewtopic.php?t=93517&highlight=buildop

This contains a sample buildop that reads a file, passes it to a buildop and then writes the output to a dataset. The buildop has an input schema that matches the input file. It has no output schema, auto-transfers input to output automatically and does not use RCP.

Hope this helps.

Brad.
nnes
Participant
Posts: 14
Joined: Mon Sep 12, 2005 1:10 pm

Post by nnes »

bcarlson wrote:For question 1, the warnings per column are because you are using autotransfer AND have specified an output schema. You need to use one or the other.
For question 2, check out the following posting: viewtopic.php?t=93517&highlight=buildop

Hope this helps.
Brad.
Excellent, thanks!
The stage still wanted an output interface, so I just left the table name blank on the output and that did the trick.

Now that the transfer is working, I want to change one of the fields so I did:

inp.CLM_NO="test";
outp.CLM_NO="test";

But the first line does not work because of:

"APT_String::operator=(char)" is not a viable candidate" and
"The implicit object parameter of type "APT_String &" cannot be initialized with an implied argument of type "const APT_String"

the second line fails because of:
"CLM_NO_buildop_accessor" is not a member of "class APT_Bop_output0Accessors".

Looking at the examples in different postings, assigning to the input or output buffer is the way to do this, so I am at loss what is happening here.

Nestr
nnes
Participant
Posts: 14
Joined: Mon Sep 12, 2005 1:10 pm

Post by nnes »

Ok, after messing arround with it some more I found out the following:

1. If you have one input and one output, RCP and Auto-Transfer do the same thing.

2. All input variables referenced in your code have to be defined in the input interface schema and all output variables referenced in your code have to be defined in the output interface schema. Overall it seems the most sensible thing to do is to only include the columns strictly necesary for your code in the interface and use RCP for the rest.

3. If you have a column you want to transform keeping the same name for it and just propagate the rest of the columns (RCP or Transfer), you will get a warning about the column existing already. The transform will still work though (i.e. you get the changed output). Make sure you eliminate all columns from the output schema you do not manually assign to in your code or you get a lots of empty columns. I have not being able to figure out a nice way (i.e. not writing assignment statements for 60 columns) of getting rid of the warnings.

4. You can not assign or make changes to any fields of the input schema, you can make changes to the output only. (the graph in the manual about input and output buffers is misleading, making you belive otherwise)

5. The name of the output fields has to match the names of the output link in the job or Datastage will complain about a wrong derivation.

6. The header fields are your friend. The header files are not like Sun's Javadocs but they are pretty good, even with examples in some cases. A local C programmer was trying to use char pointer arithmetic to operate on the Datastage strings(maybe that is actually possible and there just was a bug in the code). I replaced all that with method calls from basicstring.h and it seems to work now.

Cheers,
Nestr
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post by michaeld »

When changing the value of a column in a build op where the input column name is the same as the output column name I get this warning:
When checking operator: Dropping component "COLUMN_NAME" because of prior component with same name
-My input schema and output schema are the same.
-I have RCP turned off.

Like nnes mentioned, this does not have an impact on the transformation.

What do I have to do to remove this warning?
Mike
Post Reply