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!!!
what is '0x0', what significance it has with padchar
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
"HUB" : Char(0) : Char(0)
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>