DB2 Enterprise Stage

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
rony_daniel
Participant
Posts: 36
Joined: Thu Sep 01, 2005 5:44 am
Location: Canada

DB2 Enterprise Stage

Post by rony_daniel »

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
bandish
Participant
Posts: 41
Joined: Tue Oct 11, 2005 1:30 am

Post by bandish »

The exact name of the environment variable is

$APT_STRING_PADCHAR.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

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.
rony_daniel
Participant
Posts: 36
Joined: Thu Sep 01, 2005 5:44 am
Location: Canada

Post by rony_daniel »

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 ...
It worked with $APT_STRING_PADCHAR. Thanks bandish and Ray.

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......
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

If you supply the default value of the variable in the job parameters, then you don't have to change it. Do you always run the job from the GUI or do you run it via dsjob? If you use dsjob and the parameter has a default value, then you don't have to supply it at the command line with dsjob.

Brad.
Post Reply