Hi,
I have a generic job which is loading data from sequential file to a database.
Sequential_File --> Copy stage --> DB2 connector stage.
I have some decimal fields in the sequential file which are blank and I when I try reading the file (through schema file), it gives me the following error;
Field has import error and no default value.
I read at several forums that I need to read blank decimal fields as Varchar and then convert them into decimal fields during transformation.
Now my doubt is can I handle such string to decimal conversion in a generic job which is using RCP since I am not mentioning any columns in the stage metadata.
Varchar to decimal transformation in generic RCP job
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 37
- Joined: Wed Oct 29, 2014 10:48 pm
- Location: Ohio
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 37
- Joined: Wed Oct 29, 2014 10:48 pm
- Location: Ohio
Doesn't your schema file contain the column names? The name of the column could be passed to the job as a parameter, and then that string is used in a modify stage to create an appropriate column.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 37
- Joined: Wed Oct 29, 2014 10:48 pm
- Location: Ohio
Create yourself a little utility using your favorite tool ksh, perl, server job, parallel job, BASIC routine, or whatever.
Your utility will read through the schema file looking for decimal columns and generate all of modify specifications that you need.
Then just pass all of the modify specifications into your generic job as a job parameter.
Mike
Your utility will read through the schema file looking for decimal columns and generate all of modify specifications that you need.
Then just pass all of the modify specifications into your generic job as a job parameter.
Mike
-
- Premium Member
- Posts: 37
- Joined: Wed Oct 29, 2014 10:48 pm
- Location: Ohio