Author |
Message
|
WMBBeginner |
Posted: Wed Mar 28, 2012 1:13 am Post subject: Create Multiple Lines in File with records delimited by ~ |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
hi experts ,
I have just started using WMB and doing some R&D on it and require your help for one query that i searched on this forum but didn't get satisfactory results..
I am using WMB 7.0.0.2 and sending an XML input message(dummy):
<A>
<B>b1</B>
<C>c1</C>
<D> D is a complex type with max occurs -1
<D1>d1</D1>
<D2>d2</D2>
</D>
<D>
<D1>d3</D1>
<D2>d4</D2>
</D>
<D>
<D1>d5</D1>
<D2>d6</D2>
</D>
</A>
and i am expecting output(TDS format with delimiter "~") in a file using fileoutput node as:
b1~c1~d1~d2
b1~c1~d3~d4
b1~c1~d5~d6
I have searched the forum and i got quite useful results as replied by Kimbert : for the topic "Create Multiple Lines in a File Based on Cobol CopyBook" ; url : http://www.mqseries.net/phpBB/viewtopic.php?p=294724&sid=4056b4f9c4cb7898174d1ed497508e4d
but , it didn't help me much as still i didn't get the results as expected; I am getting:
b1~c1~d1~d2
d3~d4
d5~d6
which is not correct output
@Kimbert, I followed the same approach mentioned in the above mentioned post url except that I selected DES as "all elements delimited" and delimiter as "~" ; for complex type D, I gave Repeating element delimiter as <CR><LF> ,
Is something else to be done for message of this kind?
please help me out,
thanks in advance. 
Last edited by WMBBeginner on Wed Mar 28, 2012 1:37 am; edited 1 time in total |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 28, 2012 1:21 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
i got quite useful results as replied by Kimbert : for the topic "Create Multiple Lines in a File Based on Cobol CopyBook" |
Glad it helped. Please can you edit your post ( use the Edit button ) and add the URL of that thread, so that we don't have to search for it.
Quote: |
still i didn't get the results as expected; I am getting:
b1~c1~d1~d2
d3~d4
d5~d6 |
Please add a Trace node just before the output node. Set the pattern to "${Root}" ( don't include the quotes! ). Post the trace node output here, and please use the [ c o d e ] button so that the trace output is readable. |
|
Back to top |
|
 |
WMBBeginner |
Posted: Wed Mar 28, 2012 1:43 am Post subject: |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
thanks Kimbert for your fast response.
Actually we are using only the Develpoment toolkit and do not have access to runtime environment and the MQ explorer as it is managed by our client, so sorry for that. I can't take the trace;
Is some other configuration details you required from me?
thanks.  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 28, 2012 4:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBBeginner wrote: |
Actually we are using only the Develpoment toolkit and do not have access to runtime environment and the MQ explorer as it is managed by our client |
Question: how does your client expect you to develop without access to the development environment?
Clearly I'm impressed by your client's level of faith in that they believe you'll never write code that needs to have errors found & removed, but that would seem a bit optimistic as this issue indicates.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 28, 2012 5:16 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Well, your situation is a little 'unusual', as Vitor has already pointed out.
What steps do you normally follow when you need to diagnose a problem with a new message flow? Are you able to use the message flow debugger? |
|
Back to top |
|
 |
WMBBeginner |
Posted: Wed Mar 28, 2012 8:29 pm Post subject: |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
thanks Vitor and Kimbert for your replies
@Vitor: Yeah its difficult as well as challenging for me to develop the application without full access but we have developed and delivered most part of the application in this situaition only , but i am stuck in this mentioned problem.
We have limited access to the broker we deploy our application using SSH login through putty and running the mqsideploy command.
@Kimbert: I am using the failure and Catch terminals of appropriate nodes to figure out the places at which message has not passed the flow and then looking through the broker logs to find out the probable cause of error and then I diagonise that.Also we are using log4j plugging to log our error.
No we dont have access to message flow debugger, we use above mentioned approach to debug our appilcation.
for our situation we are getting some output but that is not as expected,
could this be due to the structure of the message that I have shown in the above?
thanks...  |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 29, 2012 4:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBBeginner wrote: |
could this be due to the structure of the message that I have shown in the above? |
It's that, it's the way you've defined the message set, it's the way WMB is interpreting your definition of the message set, it's the way your code is mapping the data, it's something I've not listed here or it's some combination of all of these factors.
Using Failure and Catch terminals only works if WMB believes there's an error; in this instance it's working perfectly fine just not to the objective you require. Likewise log4j only logs what you're telling it to log & offers no insight into what WMB is actually doing.
Without details of what is happening when the message is processed you're going to find an increased level of challenge sorting it out. I'm impressed you're delivered a robust solution already under these circumstances.
Does your client know how much additional time & effort these controls are costing their delivery process?
I don't think you have any real option but to desk check everything again & then sequence dial through the options & code possibilities until you hit one that results in the output you need. Given that you can't actually isolate the problem and fix it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 29, 2012 4:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you have access to mqsideploy, you may have access to mqsichangetrace and mqsireadlog/mqsiformatlog.
This would allow you to execute a user trace of your flow.
Being able to execute a user trace of your flow would allow you to put in a Trace node that wrote out to User Trace instead of a file, and thus see the message tree as it is being built. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 29, 2012 5:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
If you have access to mqsideploy, you may have access to mqsichangetrace and mqsireadlog/mqsiformatlog. |
Or not; a site this paranoid may have used this information to selectively authorise mqsideploy.
But it's worth a try. As my most worthy associates and I have indicated, a user trace & Trace nodes are really the only way you're going to get to the bottom of this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBBeginner |
Posted: Sun Apr 08, 2012 9:06 pm Post subject: |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
thank you Vitor and mqjeff for your valuable suggestions i had to do a lot of R&D on this and thus I am replying this much late , I am sorry for that..
@mqjeff: your suggestion was really helpful. I am able to run the command mqsichangetrace and mqsireadlog and i am able to get a user trace for my flow.. thank you..
@kimbert: i have added a Trace node just before the output node and the pattern was set to ${Root}.
input message used :
Code: |
<?xml version="1.0" encoding="UTF-8"?><tns:SampleMsg xmlns:tns="http://www.mrmnames.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mrmnames.net SampleXml.xsd "> <A> <B>B</B> <C>C</C> <D> <D1>D1</D1> <D2>D2</D2> </D><D> <D1>D2</D1> <D2>D3</D2> </D><D> <D1>D4</D1> <D2>D5</D2> </D></A></tns:SampleMsg> |
ouptput received:
Code: |
<B~C~D1~D2
~D2~D3
~D4~D5
> |
User Trace:
Code: |
Timestamps are formatted in local time, 420 minutes before GMT.
Trace written by version ; formatter version 7002 (build S700-FP02)
2012-04-08 21:54:07.657038 8652 UserTrace BIP2632I: Message received and propagated to 'out' terminal of MQ input node 'SampleFlow.MQ Input'.
2012-04-08 21:54:07.657228 8652 UserTrace BIP6060I: Parser type ''Properties'' created on behalf of node 'SampleFlow.MQ Input' to handle portion of incoming message of length 0 bytes beginning at offset '0'.
2012-04-08 21:54:07.657256 8652 UserTrace BIP6061I: Parser type ''MQMD'' created on behalf of node 'SampleFlow.MQ Input' to handle portion of incoming message of length '364' bytes beginning at offset '0'. Parser type selected based on value ''MQHMD'' from previous parser.
2012-04-08 21:54:07.657284 8652 UserTrace BIP6069W: The broker is not capable of handling a message of data type ''MQSTR''.
The message broker received a message that requires the handling of data of type ''MQSTR'', but the broker does not have the capability to handle data of this type.
Check both the message being sent to the message broker and the configuration data for the node. References to the unsupported data type must be removed if the message is to be processed by the broker.
2012-04-08 21:54:07.657366 8652 UserTrace BIP6061I: Parser type ''MRM'' created on behalf of node 'SampleFlow.MQ Input' to handle portion of incoming message of length '345' bytes beginning at offset '364'. Parser type selected based on value ''MRM'' from previous parser.
2012-04-08 21:54:07.657399 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''BEGIN ... END;'' at ('.SampleFlow_Compute.Main', '2.2').
2012-04-08 21:54:07.657434 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''SET OutputRoot.Properties.MessageFormat = 'Text1';'' at ('.SampleFlow_Compute.Main', '4.3').
2012-04-08 21:54:07.657473 8652 UserTrace BIP2566I: Node 'SampleFlow.Compute': Assigning value '''Text1''' to field / variable ''OutputRoot.Properties.MessageFormat''.
2012-04-08 21:54:07.657491 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''SET OutputRoot.Properties.MessageSet = 'JAL7D7S002001';'' at ('.SampleFlow_Compute.Main', '5.3').
2012-04-08 21:54:07.657510 8652 UserTrace BIP2566I: Node 'SampleFlow.Compute': Assigning value '''JAL7D7S002001''' to field / variable ''OutputRoot.Properties.MessageSet''.
2012-04-08 21:54:07.657537 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''SET OutputRoot.Properties.MessageType = 'SampleMsg';'' at ('.SampleFlow_Compute.Main', '6.3').
2012-04-08 21:54:07.657556 8652 UserTrace BIP2566I: Node 'SampleFlow.Compute': Assigning value '''SampleMsg''' to field / variable ''OutputRoot.Properties.MessageType''.
2012-04-08 21:54:07.657574 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''SET OutputRoot.MRM = InputRoot.MRM;'' at ('.SampleFlow_Compute.Main', '7.3').
2012-04-08 21:54:07.658109 8652 UserTrace BIP2539I: Node 'SampleFlow.Compute': Evaluating expression ''InputRoot.MRM'' at ('.SampleFlow_Compute.Main', '7.24'). This resolved to ''InputRoot.MRM''. The result was ''ROW... Root Element Type=16777249 NameSpace='' Name='MRM' Value=NULL''.
2012-04-08 21:54:07.658179 8652 UserTrace BIP2568I: Node 'SampleFlow.Compute': Copying sub-tree from ''InputRoot.MRM'' to ''OutputRoot.MRM''.
2012-04-08 21:54:07.658210 8652 UserTrace BIP2537I: Node 'SampleFlow.Compute': Executing statement ''RETURN TRUE;'' at ('.SampleFlow_Compute.Main', '30.3').
2012-04-08 21:54:07.658246 8652 UserTrace BIP4015I: Message propagated to the 'out' terminal of node 'SampleFlow.Compute' with the following message trees: ''.
2012-04-08 21:54:07.658262 8652 UserTrace BIP4067I: Message propagated to output terminal for trace node 'SampleFlow.Trace'.
The trace node 'SampleFlow.Trace' has received a message and is propagating it to any nodes connected to its output terminal.
No user action required.
2012-04-08 21:54:07.658598 8652 UserTrace BIP5494I: The logical tree is now being matched to the message model.
2012-04-08 21:54:07.658639 8652 UserTrace BIP5564I: Item ''A'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A''.
2012-04-08 21:54:07.658682 8652 UserTrace BIP5564I: Item ''B'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/B''.
2012-04-08 21:54:07.658710 8652 UserTrace BIP5564I: Item ''C'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/C''.
2012-04-08 21:54:07.658734 8652 UserTrace BIP5564I: Item ''D'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(1 of unbounded)''.
2012-04-08 21:54:07.658757 8652 UserTrace BIP5564I: Item ''D1'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(1 of unbounded)/D1''.
2012-04-08 21:54:07.658780 8652 UserTrace BIP5564I: Item ''D2'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(1 of unbounded)/D2''.
2012-04-08 21:54:07.658803 8652 UserTrace BIP5564I: Item ''D'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(2 of unbounded)''.
2012-04-08 21:54:07.658826 8652 UserTrace BIP5564I: Item ''D1'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(2 of unbounded)/D1''.
2012-04-08 21:54:07.658849 8652 UserTrace BIP5564I: Item ''D2'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(2 of unbounded)/D2''.
2012-04-08 21:54:07.658870 8652 UserTrace BIP5564I: Item ''D'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(3 of unbounded)''.
2012-04-08 21:54:07.658903 8652 UserTrace BIP5564I: Item ''D1'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(3 of unbounded)/D1''.
2012-04-08 21:54:07.658926 8652 UserTrace BIP5564I: Item ''D2'' from the logical tree has matched with the message model as ''[MESSAGE]_SampleMsg/A/D(3 of unbounded)/D2''.
2012-04-08 21:54:07.659251 8652 UserTrace BIP2638I: The MQ output node 'SampleFlow.MQ Output' attempted to write a message to queue ''MDM.INBND.GLACCOUNT.IN'' connected to queue manager ''''. The MQCC was '0' and the MQRC was '0'.
2012-04-08 21:54:07.659262 8652 UserTrace BIP2622I: Message successfully output by output node 'SampleFlow.MQ Output' to queue ''MDM.INBND.GLACCOUNT.IN'' on queue manager ''''.
Threads encountered in this trace:
8652
|
expected output was supposed to be :
Code: |
<B~C~D1~D2>
<B~C~D2~D3>
<B~C~D4~D5> |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Apr 09, 2012 7:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
For this you will need to either write some code or use a mapping node.
I notice that you seem to have a repeating header that is only present once in the source... Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
WMBBeginner |
Posted: Mon Apr 09, 2012 10:57 pm Post subject: |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
thank you fjb_saper for your reply..
actually we tried same by writing esql code in compute node and using while loop and then propagating each record line by line to the fileoutput node in our application.. and it worked... my concern here was that- some messages are having a lot of complex type with max occurs -1 and hence its very untidy for maintenance, we are writing a lot of code and when message set changes then its very difficult to modify the code..
so I thought if there could be some other way round, built in feature in WMB to handle this type of situation...
thanks....  |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 10, 2012 12:22 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I thought if there could be some other way round, built in feature in WMB to handle this type of situation... |
Can you describe exactly what this 'built in feature' would do? |
|
Back to top |
|
 |
WMBBeginner |
Posted: Tue Apr 10, 2012 1:01 am Post subject: |
|
|
Newbie
Joined: 28 Mar 2012 Posts: 6
|
hi kimbert, as you know i am new to WMB, so I thought there must some easy ways to accomplish my task instead of writing 300-400 lines of esql code..
my thought was that , in my problem, output should have element A and B repeated everytime with multiple occurence of complex type D...
what i learned....
as the environment tree keeps record of A and B elements only once hence we have to take something like while loop that will populate the value of A and B repeatedly depending upon the multiple occurence of complex type D... so we have to perform some kind of manual coding here... which we performed and that worked well... thanks for your comments..
i am still in learning phase... please correct me if my understanding is wrong..
thanks to everybody..  |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 10, 2012 1:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Well, 300 - 400 lines seems like an awful lot of code. I don't think you can blame all that code on a 'missing' feature in WMB.
Why can't you create the BLOB for the header fields once, and simply add it onto the start of each output line? Seems a lot more efficient and straightforward to me. |
|
Back to top |
|
 |
|