what is '0x0', what significance it has with 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
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

what is '0x0', what significance it has with padchar

Post by zulfi123786 »

In my project the default value for APT_STRING_PADCHAR is 0x0.
i am mapping 'HUB' to a field char(5), now when i view the data at the target i dont see any characters padded to this value. can anyone explain what is this '0x0' and what happens when this is padded.

In between i am using a transformer where i am checking if the value is 'HUB', unfortunately the condition is failing. i think the reason might be that 'HUB' is padded with '0x0'??? now if i need to check for this value in the transformer how am i supposed to do so?
should i check with 'HUB0X00X0'
please suggest!!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

"HUB" : Char(0) : Char(0) 
would be one way.

0x00 is another way to represent the single-byte character whose encoded value is 0. In ASCII this character is called NUL (not the same as NULL in SQL). This character is recognized in the C language as terminating a string, so it is a useful character with which to pad fixed length strings.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I had a similar problem, not in a Transformer, but in a Web Service because the binary zeros (see Ray's description above) were aborting the construction of the SOAP envelope. Default 00 for null padding is obnoxious (imho). Set the variable to a single blank (no quotes just = followed bya space). Then it will pad with spaces. May not solve your problem, but will at least make it more sane to comprehend.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply