APT_STRING_PADCHAR

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
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

APT_STRING_PADCHAR

Post by vamsi.4a6 »

Hi ALL,

I/p
col1,col2,col3
2,b,100
6,f,200
1,a,10
5,e,300
3,c,30
4,d,20


col1- integer
col2-varchar
col3-integer
o/p

col1,col2,col3
col1,col2,col3
2,bzzzz,100
6,fzzzz,200
1,azzzz,10
5,ezzzz,300
3,czzzz,30
4,dzzzz,20

In transfomer I changed the Data type from varchar to char(5) for col2

and APT_STRING_PADCHAR is assigned to z

But I am getting following output

col1,col2,col3
2,b,100
6,f,200
1,a,10
5,e,300
3,c,30
4,d,20
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

Post by srds2 »

That's the ASCII value you set for APT_STRING_PADCHAR

eg:0x0 (ASCII null) is the default value

So, I think there should be corresponding value for ASCII Z
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

1st understand about APT_STRING_PADCHAR.

Datastage CHAR fields are always padded to their full size and the environment variable that controls that is APT_STRING_PADCHAR.

By default it is set to '0x00' (hex zeroes or low-values) which is what you are currently seeing.

Add $APT_STRING_PADCHAR to your job and change it to '0x20' if you need to have them padded with spaces (a hex 20 is a space).

Or use whatever other value you'd prefer.

Thanks
Man
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

More specifically, APT_STRING_PADCHAR only applies the CHAR data types. It does not apply to Integer or VarChar data types.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

Thanks alot for your inputs

I am getting required output after changing the value from z to 0x7A for the variable APT_STRING_PADCHAR.But I have small clarification.Could any body please clarify below doubt

1)Do we need to use Hexadecimal notation while assigning the value for APT_STRING_PADCHAR variable everytime.Can not we assign z or 'z' directly to APT_STRING_PADCHAR?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can assign "z" directly to APT_STRING_PADCHAR.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply