Hi All,
I am using db2 enterprise stage to load data from a sequential file in fixed length format. My database has some fields
which are char(30) type. When i load data to these fields some junk characters are coming if the length of the data is
less than 30.
i.e. if source data is "abcdef"
then this in target db2 wold become "abcdef*********".
The junk character is not "*" but some other which i cannot put it here.
The problem is not there if i am using db2 API stage. But i need to use Enterprise stage itself. Any help please...
Thanks
DB2 Enterprise Stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 36
- Joined: Thu Sep 01, 2005 5:44 am
- Location: Canada
The reason is the pad character that you have set, most likely in your enterprise stage, I belive the default is to pad with null (0x00) and you need to change that to space for your CHAR variables. I'm not at a system with documentation or DS right now so I cannot give you the exact settings to use, but if you look at your stage you will find the attributes in the edit row set of windows in the designer.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
From memory there's an environment variable called something like APT_PAD_CHARACTER (maybe APT_STRING_PAD_CHARACTER). You can set this up as a job parameter so that you can override it just in one job. As with Arnd, I am not using DataStage this week, so that answer's from memory.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Make sure your schema going into the DB2 stage has the same field lengths as the target table. For example, if you have a name field in the target table that is char(30), then the input field should be string[30,padchar=' '].
See this related posting for more details (page 2 of the topic):
UDB API stage
Brad.
See this related posting for more details (page 2 of the topic):
UDB API stage
Brad.
-
- Participant
- Posts: 36
- Joined: Thu Sep 01, 2005 5:44 am
- Location: Canada
It worked with $APT_STRING_PADCHAR. Thanks bandish and Ray.ray.wurlod wrote:From memory there's an environment variable called something like APT_PAD_CHARACTER (maybe APT_STRING_PAD_CHARACTER). You can set this up as a job parameter so that you can override it just in one jo ...
But if i want to set this varaible permenantly for this job alone and i don't want to give as a job parameter as every time the job is run the parameter window pops up. Any other work around please......