Author |
Message
|
asr |
Posted: Wed Nov 20, 2002 10:47 am Post subject: msg set developing ??? |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
Hi Guys!!!
These are steps i have done to create a message set
1. i created all the four elements , first three are String and fourth one is interger.
2. then i created maxLength(5) to String elements and created max Inclusive (2) for integer element
3. created a message set of type MRM
4. repeated same 1,2 and 3 to create a message set of type XML
i added CWF to MRM message set and XML layer to XML message set ie. i'm trying to convert MRM-CWF to XML
Below is my input and results:
INPUT:1111122222333334444 - goes to output
INPUT:111112222233333444 - goes to failure
output:
<FULLNAME><FIRSTNAME>11111</FIRSTNAME><LASTNAME>22222</LASTNAME><MIDDLENAME>33333</MIDDLENAME><TEST_XML_INT>875836468</TEST_XML_INT></FULLNAME>
My questions are:
1. i have created max inclusive to be 2 for the integer element ie.TEST_MRM_INT even the the following input goes to failure
INPUT:111112222233333444 - goes to failure
2. if my second input is INPUT:1111122222333334444 - goes to output but get some value 875836468.
3. Is my msg set lenght set to 5+5+5+2 = 17 ? if yes then the following input should work 11111222223333344 - but goes to failure
could any please help how to handle this kind of situations for INTEGER, DECIMAL and FLOAT. its important to me, i appreciate for your time...
Thanks in Advance... |
|
Back to top |
|
 |
Tibor |
Posted: Wed Nov 20, 2002 1:23 pm Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
MRM parser is working fine, because '4444' is x'34343434' (hex) or 875836468 (decimal). You have to set the correct Physical Type at CWF tab, because default is binary, 4-byte length.
Tibor |
|
Back to top |
|
 |
asr |
Posted: Wed Nov 20, 2002 2:22 pm Post subject: |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
Hi Tibor,
thanks for ur reply, ur right i tried to change that value ie. Length Count = 2, but i'm unable to edit the CWF tab values... how can i edit the values in the CWF tab.... and how can i make sure it takes only 2 bytes and in the required format ie.4444 any suggestions please
Thanks in advance |
|
Back to top |
|
 |
lung |
Posted: Wed Nov 20, 2002 4:50 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
asr,
I suggest you define everything as STRING in your message set, unless you're using binary (which you will define as INTEGER in your message set) or packed decimal (which you will define as DECIMAL).
If you're using normal human-readable integers, just define them as string. If you're planning to use them for computation in your ESQL, you can always CAST them as INT first.
 _________________ lung |
|
Back to top |
|
 |
asr |
Posted: Wed Nov 20, 2002 6:07 pm Post subject: |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
Hi lung,
i'm able to edit CWF tab, and now i'm getting output as i expected ie. 4444.
but how to define decimal and float in mqsi 2.1??? when we import copybook it has some elements as decimal and float.
any suggestions.... please |
|
Back to top |
|
 |
kirani |
Posted: Wed Nov 20, 2002 7:30 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
WMQI should create appropriate elements (with datatypes) into MRM after you import the copybook. WMQI COBOL importer does not support following datatypes:
- Binary (10 to 18 digits)
– External floating point
– The DBCS datatype
If you have an element whose pic clause is PIC 9(5)., WMQI will create an Integer element of length 5 bytes. MRM Physical type for this element will be set to Extended Decimal in CWF tab.
I hope this helps. _________________ 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 |
|
 |
asr |
Posted: Wed Nov 20, 2002 10:25 pm Post subject: |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
hi kirani,
thanks kirani, could u please give me same examples for FLOAT and DECIMAL also how WMQI accepts like the one you have given for INTEGER...
i'm new to cobol, i have PIC S9(7)V99 COMP-3 which has imported as FLOAT, but i dont know how many bytes did WMQI takes internally.... 'cause i want to know the msg length.
once again thanks for ur response |
|
Back to top |
|
 |
kirani |
Posted: Thu Nov 21, 2002 7:43 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi asr,
This element (PIC S9(7)V99 COMP-3) should have following set in CWF tab:
Physical Format: Packed Decimal
Total Length: 5 Byts
Virtual Decimal: 2
Signed: Yes
Another Example:
Element: PIC S9(4)V9(3).
Physical Format: Extended Decimal
Total Length: 7 Byts
Virtual Decimal: 2
Signed: Yes
I hope this helps. _________________ 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 |
|
 |
lung |
Posted: Thu Nov 21, 2002 10:26 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Kiran,
For my PIC S9(6)V99 (or whatever), I never define any Virtual Decimal values in my CWF tab... And WMQI is still able to read in everything successfully.
I suppose the you only set values for Virtual Decimal if you're planning to do computations with the element. If you're just taking in the data and parsing it to XML (or whatever) and send it to the output queue (which is very true in my case), then I suppose you can just leave the Virtual Decimal field untouched.
asr, PIC S9(7)V99 COMP-3 wil take up as many bytes as it will take in COBOL as WMQI will take... That is 7+2/2 = 7.
 _________________ lung |
|
Back to top |
|
 |
lung |
Posted: Thu Nov 21, 2002 10:28 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Oops. I mean (7+2)/2 = 4.5. Add 0.5 to it and treat it as 5 bytes.
How did I end up with 7 bytes in the first place... I need coffee
 _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Fri Nov 22, 2002 8:38 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Lung wrote: |
I suppose the you only set values for Virtual Decimal if you're planning to do computations with the element. If you're just taking in the data and parsing it to XML (or whatever) and send it to the output queue (which is very true in my case), then I suppose you can just leave the Virtual Decimal field untouched.
|
Are you referencing to this element in your ESQL code at all? I guess not. _________________ 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 |
|
 |
asr |
Posted: Fri Nov 22, 2002 9:37 pm Post subject: |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
Hi Kiran,
once again thanks for ur response, kiran i have data types of float, integer and decimal in my msg set. For float i'm trying to set
Physical Format: Packed Decimal
Total Length: 5 Byts
Signed: Yes
but it gives parser error,
ParserException BIP5167E: Error with Custom Wire Format: message set 'DRIOBQG082001'; message 'TEST_MSG'; parent element 'CURRENT'; current element 'FLOAT_TEST' ; function name 'CWFWorker::parseNext'; error code '0'. Custom Wire Format General Error.
if i'm using
Physical Format: Extended Decimal
Total Length: 5 Byts
Signed: Yes
it is working.
OUTPUT:
<FIELD1>1.234567E+4</FIELD1>//THIS IS FLOAT SET 7 BYTES
<FIELD2>12345678901234567</FIELD2>// INTEGER SET 17 BYTES
so for FLOAT, INTEGER, DECIMAL i'm using Extended Decimal and i'm able to see the values in the output message.. pl, correct me if i'm doing wrong
thanks |
|
Back to top |
|
 |
kirani |
Posted: Sat Nov 23, 2002 10:17 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi asr,
Could you pl explain what exactly are you trying to do here? Are you converting input XML message to CWF (COBOL) 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 |
|
 |
asr |
Posted: Sat Nov 23, 2002 12:01 pm Post subject: |
|
|
Novice
Joined: 19 Nov 2002 Posts: 11
|
hi kiran,
i have imported cobol copybook as MRM-CWF and trying to convert into XML format.
thanks |
|
Back to top |
|
 |
kirani |
Posted: Sun Nov 24, 2002 1:00 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi asr,
How are you putting your test message on the input queue? Since you are expecting input message in COBOL copybook format with COMP-3 fields, you should write a COBOL program to put message on the queue. You cannot create COMP-3 data by hand, they have to created using some program, they need specific values set in some of the bytes.
If you don't want to use COMP-3 fields in your input message then define your fields as Extended Decimal so that you can enter the data by hand. _________________ 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 |
|
 |
|