Author |
Message
|
agrawalamit166 |
Posted: Tue Sep 13, 2016 12:31 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
sorry, my mistake... Here is hex data:
Code: |
45 46 34 39 30 4c 4f 47 20 2d 20 49 6e 76 61 6c 69 64 20 41 63 74 69 6f 6e 3a 20 2a 52 45 56 4f 4b 45 2a 20 4d 75 73 74 20 62 65 20 53 45 54 55 50 2c 20 41 55 54 48 2c 20 4f 52 20 53 45 54 50 52 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
|
|
Back to top |
|
 |
timber |
Posted: Tue Sep 13, 2016 1:31 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Thanks - but that's the entire message. We are only interested in the bytes that relate to the field that you are struggling with. It's all there in the DFDL Test perspective if you look carefully. |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Tue Sep 13, 2016 1:52 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
you are right.. here is the one field data (200 characters). where I am getting issue:
first 67 characters - Actual response
next 13 characters - nul character
next 120 characters - space
Code: |
45 46 34 39 30 4c 4f 47 20 2d 20 49 6e 76 61 6c 69 64 20 41 63 74 69 6f 6e 3a 20 2a 52 45 56 4f 4b 45 2a 20 4d 75 73 74 20 62 65 20 53 45 54 55 50 2c 20 41 55 54 48 2c 20 4f 52 20 53 45 54 50 52 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
|
|
Back to top |
|
 |
timber |
Posted: Tue Sep 13, 2016 2:29 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
So the sender is padding the field with a mixture of low-values and spaces. That's not a nice thing to do. To be fair to the sender, the problem may have started further back up the chain.
Either way, this is no longer a DFDL modelling problem. It is a message flow design problem. You cannot send those low-values in an XML message because XML does not allow it even if you wrap the data in CDATA tags. Your message flow must either trim off any trailing null characters from this field value (and any other field values that might be contain nulls) or else it must TRANSLATE the null values to spaces. Your choice (or maybe your architect's choice). |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Tue Sep 13, 2016 3:52 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
Thanks Timber,
You are absolutely right. We should not get mix element Nul with Spaces.
We figured out the problem, it's from mainframe side; they were copying data from 80 char field to 200 char field. Now they initialize the 80 char field to space before copying data, which fixes our problem. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Sep 13, 2016 10:20 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Well done!
In cases like this looking at the original data is always a good move. Now you have seen it for yourself, you won't be surprised by it in future when you get stumped.
I won't be alone in saying that the number of times the more experienced of us have seen this ourselves is HUGE.
Garbage In - Garbage Out strikes again.
I'm glad that you were able to get the Mainframe error corrected. This is not always the case. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
timber |
Posted: Tue Sep 13, 2016 11:57 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Now they initialize the 80 char field to space before copying data, which fixes our problem. |
That's a great result.
If I were in your shoes, I would ask the mainframe team to check whether any other fields need the same treatment. |
|
Back to top |
|
 |
shanson |
Posted: Wed Sep 14, 2016 12:12 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
Quote: |
I think we now have all the facts.
- You have some fields that, when nil, are entirely filled with low-values. You should model those with nilKind='literalCharacter' and nilValue='%#r00'
- You have some fields that, when nil, are entirely filled with spaces. You should model those with nilKind='literalCharacter' and nilValue='%SP;'
- You have some fields that, when nil, contain one or more low-valued bytes followed by spaces for padding. You should model those with nilKind='literalvalue' nilValue='%#r00' textStringPadCharacter="%SP;" |
I think this needs one adjustment.
I think we now have all the facts.
- You have some fields that, when nil, are entirely filled with low-values. You should model those with nilKind='literalCharacter' and nilValue='%#r00;'
- You have some fields that, when nil, are entirely filled with spaces. You should model those with nilKind='literalCharacter' and nilValue='%SP;'
- You have some fields that, when nil, contain exactly one low-valued byte followed by spaces for padding. You should model those with nilKind='literalvalue' nilValue='%#r00;' textStringPadCharacter="%SP;"
If you need to handle two low-valued bytes followed by padding then you need nilValue='%#r00;%#r00;'. Ando so on.
If you want to set this up so it handles any number of low-valued bytes followed by padding then you need nilValue='%#r00; %#r00;%#r00; %#r00;%#r00;%#r00;' etc - a space-separated list - you get the idea. This will degrade performance though. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 14, 2016 2:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
shanson wrote: |
Quote: |
I think we now have all the facts.
- You have some fields that, when nil, are entirely filled with low-values. You should model those with nilKind='literalCharacter' and nilValue='%#r00'
- You have some fields that, when nil, are entirely filled with spaces. You should model those with nilKind='literalCharacter' and nilValue='%SP;'
- You have some fields that, when nil, contain one or more low-valued bytes followed by spaces for padding. You should model those with nilKind='literalvalue' nilValue='%#r00' textStringPadCharacter="%SP;" |
I think this needs one adjustment.
I think we now have all the facts.
- You have some fields that, when nil, are entirely filled with low-values. You should model those with nilKind='literalCharacter' and nilValue='%#r00;'
- You have some fields that, when nil, are entirely filled with spaces. You should model those with nilKind='literalCharacter' and nilValue='%SP;'
- You have some fields that, when nil, contain exactly one low-valued byte followed by spaces for padding. You should model those with nilKind='literalvalue' nilValue='%#r00;' textStringPadCharacter="%SP;"
If you need to handle two low-valued bytes followed by padding then you need nilValue='%#r00;%#r00;'. Ando so on.
If you want to set this up so it handles any number of low-valued bytes followed by padding then you need nilValue='%#r00; %#r00;%#r00; %#r00;%#r00;%#r00;' etc - a space-separated list - you get the idea. This will degrade performance though. |
On a hunch I'd say that the low values are some COBOL initialization of the field, and the space values are the overall initialization... Ideally this should then be taken care of with defining the individual initialization / null value of the fields. _________________ MQ & Broker admin |
|
Back to top |
|
 |
|