Author |
Message
|
LearnMQSI |
Posted: Thu Mar 09, 2006 2:48 pm Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
I'm so sorry for confusing.
Actually, initially I thought I will be doing MRM to XML but my requirements have been changed so now I need to do both MRMtoXML and XMLtoMRM.
Now, my both MRMtoXML and XMLtoMRM working a sort of but I have another issue with my WHILE LOOP in MRMtoXML message flow.
I have to do the following:
LocationSection: (Repeat 100 times)
Map Fields (29 Fields)
Coverage Section: (Repeat 350 times within Location Section)
Map Fields(20 Fields)
Last Field Repeat 10 times within Coverage Section
So, For One Location, Coverage would repeat 350 times, last field in Coverage would repeat 10 times. So I have nested WHILE loop till 3 level
I have my WHILE loop as follows:
DECLARE I INTEGER;
DECLARE J INTEGER;
DECLARE K INTEGER;
DECLARE LOC INTEGER;
DECLARE CVG INTEGER;
DECLARE LASTFLD INTEGER;
SET I = 1;
SET LOC = 100
WHILE I <= LOC DO
MAP ALL FIELDS
SET J = 1;
SET CVG = 350;
WHILE J <= CVG DO
MAP ALL FIELDS BUT THE LAST ONE;
SET K = 1;
LASTFLD = 10;
WHILE K <= LASTFLD DO
MAP LAST FIELD
END WHILE;
SET J = J + 1;
END WHILE;
SET I = I + 1;
END WHILE;
What happening is:
My first WHILE is going good, Second one going good, and even tihrd one going good for the first time around.
When first time LASTFLD repeating 10 times, it is going back to CVG WHILE and this time around CVG repeating all 350 times but not the LAST FIELD repeating at all.
In fact its not even mapping the last field.
Once CVG finish 350 times, it has to go back to LOC second time around and must CVG again for 350 times but not happening. Its just repeating LOC for next 99 times and finishing my loop.
I'm not sure, if I explain it more clearly if this is not clear enough!!!
Am I missing anything here in loop, I would be highly appreciated if somebody can shed some light on this where I'm doing wrong.
Thank you, _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
JT |
Posted: Thu Mar 09, 2006 3:17 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
DECLARE I INTEGER;
DECLARE J INTEGER;
DECLARE K INTEGER;
DECLARE LOC INTEGER 100;
DECLARE CVG INTEGER 350;
DECLARE LASTFLD INTEGER 10;
SET I = 1;
WHILE I <= LOC DO
MAP ALL FIELDS
SET J = 1;
WHILE J <= CVG DO
MAP ALL FIELDS BUT THE LAST ONE;
SET K = 1;
WHILE K <= LASTFLD DO
MAP LAST FIELD
SET K = K + 1;
END WHILE;
SET J = J + 1;
END WHILE;
SET I = I + 1;
END WHILE;
|
|
|
Back to top |
|
 |
LearnMQSI |
Posted: Fri Mar 10, 2006 12:11 pm Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Thanks JT, I will try it and let you know how it goes!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
LearnMQSI |
Posted: Sat Mar 11, 2006 2:36 pm Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi JT,
Initially I had the same logic (while loop) setup as you mentioned except declaring variables with their size in the declare command itself.
Its still behaving the same as it used to be, i.e. First time its going in LASTFLD loop and from second time onwards, its not.
Again, my WHILE loop is like this
SET I = 1;
WHILE I <= LOC DO
-----MAP ALL FIELDS
-----SET J = 1;
-----WHILE J <= CVG DO
-------------MAP ALL FIELDS BUT THE LAST ONE;
-------------SET K = 1;
-------------WHILE K <= LASTFLD DO
---------------------MAP LAST FIELD
---------------------SET K = K + 1;
-------------END WHILE;
-------------SET J = J + 1;
-----END WHILE;
-----SET I = I + 1;
END WHILE;
Of course, this time I put all those dashes just for indentation purpose here to show my WHILE loop clearly, NOT in my msg flow.
Please help me here!!!
Is RETURN FALSE; would help me here??? _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Mar 12, 2006 5:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Return False usually only applies to flows using propagate.
Are you using CARDINALITY to get your LOC, CVG, and etc?
Can you describe better what K is for - if you only have one field to map what do you need a loop for? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
LearnMQSI |
Posted: Sun Mar 12, 2006 7:34 am Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi Jeff,
I set Copy Headers so, in that sense, yes, I'm using CARDINALITY but to get my LOC, CVG, and etc, I know that they have to repeat a certain number of times which is hardcoded. Actually, K is just a integer variable I'm using to ITERATE one of my WHILE loop.
I have a situation to loop this one last field within CVG to repear for 10 times, thats where I'm using K in my WHILE loop.
I appreciate your response and help!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
LearnMQSI |
Posted: Wed Mar 15, 2006 4:30 pm Post subject: Physical Type is Integer (Issue) |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi There,
I have a field imported from Cobol Copybook of type COMP.
Its PIC clause is as PIC S9(9) COMP.
I have set its physical type to Integer, Length Count = 4.
I'm doing XML-to-MRM. Its going through but the data is not good.
I have put value in my XML file as 888658448. I guess it is a plain string without quotes. I received this data in my Fixed Length message as 4÷Ú..
Now, I did the following in message flow:
SET OutputRoot.MQMD.CodedCharSetId = 500;
SET OutputRoot.MQMD."Encoding" = 785;
SET "OutputRoot"."MRM"."SML_MSG"."FU" = CAST("InputRoot"."XML"."SmlMsg"."FU" AS INTEGER);
Message going from Windows to Z/OS. Am I using the correct CCSID & Encoding????
Please put me in the right direction. I will be highly appreciated!!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 15, 2006 5:27 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
I received this data in my Fixed Length message as 4÷Ú. |
Where are you seeing this.
EddieA wrote: |
Quote: |
The data in this particular field is non-readable |
Non-readable where. This is a binary/integer field. It won't be readable by something that only displays characters. |
Addendum: 888658448 = x'34F7DA10'. Hmmm x'34' = ASCII '4'. Guess you might not know the difference between binary numbers and printable characters after all.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
LearnMQSI |
Posted: Wed Mar 15, 2006 7:00 pm Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi EddieA,
I did not understand you. Could you please clarify me.
Actually, I'm looking the result value in IH03 as both i.e. Data and Hex.
The Hex value showing in IH03 is 4÷Ú.
This is part I don't understand. What tool should I use to look the proper EBCDIC Hex values?
Again, I highly appreciated your help!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 16, 2006 9:58 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
The Hex value showing in IH03 is 4÷Ú. |
Not possible. Hex values consist only of digits 0 - 9 and letters a - f.
I'd still say you are looking at the character representation of a hex value.
In rfhutil, click the "Both" button. The character will be on the left, the hex on the right. Cut/paste what you are seeing, so we can also see it.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
LearnMQSI |
Posted: Thu Mar 16, 2006 11:39 am Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi EddieA,
First of all, thank you so much for sheding some lights on my issue. You are right, actually I was looking the wrong way.
Now, whats happening is this:
I did a XML-to-MRM
- Field physical type - Integer (Origin COMP from CobolCopybook PIC S9(9) COMP.)
- Length Count - 4
- I put value in my XML file - 976400000
- I set the CCSID as - 500 (Which is default on Z/OS)
- I set the Encoding as - 785 (Which is default on Z/OS)
- I CAST this field as Integer as follows
SET OutputRoot.MRM.FLD1 = CAST(InputRoot.XML.Fld1 AS INTEGER);
- I got a hex value for above data is - 3A32AE80 (Which is good)
I did a MRM-to-XML
- I set the CCSID as - 437 (Which is default on Windows)
- I set the Encoding as - 546 (Which is default on Windows)
- I CAST this field as CHARACTER
SET OutputRoot.XML.Fld1 = CAST(InputRoot.MRM.FLD1 AS CHARACTER);
- I put the above generated HEX value - 3A32AE80 in FLD1 field which is showing in IH03 as ..ÞØ
- I got the value in my XML as - -837361960 with minus sign
Note - I was expecting value here is 976400000.
Am I wrong here? Am I getting the right value here?
Please help me here, I will be highly appreciated!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 16, 2006 11:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
LearnMQSI wrote: |
SET OutputRoot.XML.Fld1 = CAST(InputRoot.MRM.FLD1 AS CHARACTER CodedCharSetId InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding); |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
LearnMQSI |
Posted: Thu Mar 16, 2006 6:52 pm Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi jefflowrey,
Thank you so much for this help. I will try it and let you know how it goes.
Again, thank you for all of you guys who helped me here!!! _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
LearnMQSI |
Posted: Fri Mar 17, 2006 7:18 am Post subject: |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
LearnMQSI wrote: |
Hi jefflowrey,
Thank you so much for this help. I will try it and let you know how it goes.
Again, thank you for all of you guys who helped me here!!! |
Hi Jefflowrey,
I tried it. First of all, it was complaining about CodedCharSetId, so I changed it to CCSID, then no Syntax errors but whenI run it, still the same output.
So now this is how my code looks like this:
SET OutputRoot.XML.Fld1 = CAST(InputRoot.MRM.FLD1 AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding);
my XML still showing - <Fld1>-837361960</Fld1>
Do you think I'm missing something here??? _________________ IBM Certified System Administrator - WebSphere MQ 5.3 |
|
Back to top |
|
 |
EddieA |
Posted: Fri Mar 17, 2006 9:43 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
I did a MRM-to-XML
- I set the CCSID as - 437 (Which is default on Windows)
- I set the Encoding as - 546 (Which is default on Windows)
- I CAST this field as CHARACTER
SET OutputRoot.XML.Fld1 = CAST(InputRoot.MRM.FLD1 AS CHARACTER);
- I put the above generated HEX value - 3A32AE80 in FLD1 field which is showing in IH03 as ..ÞØ
- I got the value in my XML as - -837361960 with minus sign
Note - I was expecting value here is 976400000. |
How did you put that value in the field. Do you understand about how binary numbers are stored on different achitectures.
If, when you looked at the field, in the message, you actually saw 3A32AE80, then that really equates to 80AE323A, which is a negative number. Unfortunately, I can't seem to get it to equate to the negative number you give as the result.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|