Author |
Message
|
kudlanka |
Posted: Wed May 04, 2011 1:30 pm Post subject: MRM parser set fixed lenght field to null |
|
|
Novice
Joined: 19 Mar 2009 Posts: 20 Location: Prague
|
Hello.
I have message defined as COBOL copybook (only part of whole copybook):
Code: |
01 FCS-CHCK-OLI-O-V1.
******* OUTPUT HEADER FOR FLATFILE (BE->FE)
******* INF,REQUEST TIME STAMP
05 D001O-REQ-TS PIC N(26).
******* TRANSACTION IDENTIFICATION
05 D001O-REQ-ID-EN PIC N(28).
******* INF,DISTRIBUTION CHANNEL
05 D001O-DTB-CNL-CD PIC N(02).
******* INF,NOT USED
05 D001O-SWR-PKG-CD PIC N(04).
******* UC, MAIN PROGRAM
05 D001O-MAIN-PGM-NM PIC N(08).
|
Message I want to parse looks like this (again only part of message):
Code: |
2011-05-03-11.34.30.377+0212345678901234567890123456_101 TESTTESTOLI0100101
|
In the message set is set that fields are fixed length and encoding null values = SPACE
Parsing is done in ResetContentDescriptor node, where is set MRM domain and correct message set and message type
On position related to D001O_SWR_PKG_CD is 4 spaces (before TESTETEST). and parser does this - D001O_SWR_PKG_CD is null but 4 spaces are still here and shift the rest of reuslt (again only part of trace node):
Code: |
(0x01000021:Name+):MRM = ( ['mrm' : 0x1310e1d10]
(0x0300000B:NameValue+):D001O_REQ_TS = '2011-05-03-11.34.30.377+02' (CHARACTER)
(0x0300000B:NameValue+):D001O_REQ_ID_EN = '12345678901234567890123456_1' (CHARACTER)
(0x0300000B:NameValue+):D001O_DTB_CNL_CD = '01' (CHARACTER)
(0x0300000B:NameValue+):D001O_SWR_PKG_CD = NULL
(0x0300000B:NameValue+):D001O_MAIN_PGM_NM = ' TEST' (CHARACTER)
(0x0300000B:NameValue+):D001O_LOG_APC_CD = 'TESTOLI0' (CHARACTER)
(0x0300000B:NameValue+):D001O_FTN_CD = '10' (CHARACTER)
(0x0300000B:NameValue+):D001O_PTT_LVL_CD = '01' (CHARACTER)
(0x0300000B:NameValue+):D001O_CTR_NO = '01' (CHARACTER)
|
I cannot find why, what is wrong?
Thank you for any help,
Kudlanka |
|
Back to top |
|
 |
kimbert |
Posted: Wed May 04, 2011 2:40 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
What is the value of the 'Encoding Null' property for that element? |
|
Back to top |
|
 |
kudlanka |
Posted: Wed May 04, 2011 2:47 pm Post subject: |
|
|
Novice
Joined: 19 Mar 2009 Posts: 20 Location: Prague
|
The value of Encoding Null is NullLiteralFill |
|
Back to top |
|
 |
flahunter |
Posted: Wed May 04, 2011 6:33 pm Post subject: |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
Quote: |
encoding null values = SPACE |
I guess you are using CWF.
NullLiteralValue
The Encoding Null Value property is interpreted as a string value. Therefore, the value of the element in the bit stream must match exactly the value that is specified to be interpreted as a null value.
Please don't set encoding null values = SPACE, as SPACE will be interpreted as a null value. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 04, 2011 8:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to set a user trace to see what the parser does and why...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 05, 2011 1:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Please don't set encoding null values = SPACE, as SPACE will be interpreted as a null value. |
flahunter: There is nothing at all wrong with setting the 'Encoding Null Value' property to SPACE. kudlanka wants his field that is filled with spaces to be interpreted as a null value, and his settings look absolutely correct to me.
kudlanka: Looks as if you have set up the message set correctly. You may have found a defect in the MRM parser, but I would be surprised - this is a widely-used feature, so it would probably have been found and reported a long time ago.
I suggest that you experiment with NullLiteralValue and/or NullPadFill instead of NullLiteralFill. |
|
Back to top |
|
 |
kudlanka |
Posted: Thu May 05, 2011 4:04 am Post subject: |
|
|
Novice
Joined: 19 Mar 2009 Posts: 20 Location: Prague
|
kimbert: I set Encoding Null to NullLiteralValue and encoding null values = SPACE and now it works as I expect and I hope that there will not be any surprise.
Thank you to all. |
|
Back to top |
|
 |
|