I have a job that uses a schema file in the sequential file stage. It is all working in terms of loading the file correctly into the database.
job flow:
Sequential File -> Transformer -> Load database
schema file has a field called dollar_cd.
I need to use the dollar_cd field inside the transformer stage. But I don't know how to reference the field name in the transformer? Anyone knows how it works in terms of referencing any of the fields in the schema file?
thanks,
how to reference input columns listed in schema file
Moderators: chulett, rschirm, roy
Just declare "dollar_cd" in the input link of the transform stage with the appropriate data type length and then you can work with that column, assuming that it is being delivered via RCP. You can check this by turning on OSH_PRINT_SCHEMAS to see which columns are being pushed through each link.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
thanks,
RCP is turned on.
yes, I can use the dollar_cd field in the transformer now. But when I try to use another column from the schema file, I have an error saying "Field DOLLAR_AMT has import error and no default value".
DOLLAR_AMT field is decimal[38,10]
What I did then, was going to Sequential File -> Format tab -> Field defaults -> add Null field value=0.
But the job still has the same error.
what can I do to resolve it.
thanks,
RCP is turned on.
yes, I can use the dollar_cd field in the transformer now. But when I try to use another column from the schema file, I have an error saying "Field DOLLAR_AMT has import error and no default value".
DOLLAR_AMT field is decimal[38,10]
What I did then, was going to Sequential File -> Format tab -> Field defaults -> add Null field value=0.
But the job still has the same error.
what can I do to resolve it.
thanks,
You need to create a default value for DOLLAR_AMT. In your schema file add "default=0" or something similar.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I gave you the syntax, you need to add the "default=0" string, e.g.
Code: Select all
URVA:decimal[1,0] {, default=0,zoned,unsigned};
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
ArndW wrote:Just declare "dollar_cd" in the input link of the transform stage with the appropriate data type length and then you can work with that column, assuming that it is being delivered via RCP. You can che ...
Hi Arndw,
Do we really have to declare it again as we already have RCP enabled, so it's definition should automatically pass to transformer stage?
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am