|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Padding / Encoding Null question |
« View previous topic :: View next topic » |
Author |
Message
|
dschott |
Posted: Fri Sep 06, 2002 9:37 am Post subject: Padding / Encoding Null question |
|
|
Newbie
Joined: 06 Sep 2002 Posts: 2
|
I have an integer mrm field defined for my input data as having a physical type of extended decimal with a length of 6. The input data is not always a length of six, but the output needs to be a length of 6 so I need to pad the data with zeros. On the CWF tab, I have tried using the Encoding Null parameters of NULLPadFill and NULLLogialValue but neither one will pad the number with zeros. I have also tried using Padding Characters of '0' and 0. Am I missing something or is there another way to accomplish this? My output for this is xml.
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Fri Sep 06, 2002 10:07 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Padding is applied only when you create output message.
For Extended Decimal elements, you must specify the size of the element. In your example, your input data must be 6 bytes long (either padded with 0's or NULL's). You will have to change your source application to generate 6 bytes of integer data. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
sgopal |
Posted: Fri Sep 06, 2002 3:44 pm Post subject: |
|
|
Acolyte
Joined: 30 Jul 2002 Posts: 63
|
Quote: |
your input data must be 6 bytes long (either padded with 0's or NULL's). You will have to change your source application to generate 6 bytes of integer data. |
Kiran, i feel it is not necessarily that input data should be of length 6. If i have an input element with size less than 6, say 4. If i want to move that to 6 bytes long element, which is defined as extended decimal, size of 6 and padding zeros then the output element should be of 4 + 2 zeros padded. |
|
Back to top |
|
 |
kirani |
Posted: Fri Sep 06, 2002 4:05 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Gopal,
Sorry, if i wasn't clear enough in my post. I was talking with reference to element in the input message set.
For example, if you define only one element of lenght 6 in a message set and if you try to send 4 bytes integer number, it will fail to parse input message. You must send 6 bytes of input data.
In dschott's post, it says
dschott wrote: |
...The input data is not always a length of six, but the output needs to be a length of 6...
|
If I understand the post correctly, their input integer data lengh is not fixed. So, first they will have to find out a way to read variable lengh of integer data. After that, they will have to reformat it to a fixed length data with appropriate padding char before converting it to XML format. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
wolstek |
Posted: Thu Sep 12, 2002 7:53 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
How about this to get the result in a different way
Code: |
DECLARE dec1 DECIMAL;
SET dec1 = CAST(InputRoot.MRM."InputField" AS DECIMAL(6,0));
SET OutputRoot.MRM."OutputField" = dec1; |
I have used this technique to transform data from any input format with/without decimals to a required format with a fixed number of decimals. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|