Author |
Message
|
Broker |
Posted: Mon Mar 19, 2012 11:22 am Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
Sorry SAP actually places it in a queue and I take the file using the MQINPUT.
Sorry I was confused with the group indicators.
I use this code to count the occurances of Body 627 but as every time the field is being created it returns a count of 1.
CARDINALITY (InputRoot.MRM.Field_6.Body_tag_27[]) |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Mar 19, 2012 11:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You probably need to use a SELECT statement to find all the relevant body fields. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 11:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
SAP actually places it in a queue and I take the file using the MQINPUT. |
Ok, I should have been clearer. Why are you not using the SAP adapters? There are a number of possible good reasons. Do you have access to any of the SAP artifacts?
Broker wrote: |
I use this code to count the occurances of Body 627 but as every time the field is being created it returns a count of 1. |
That's because both the code & the message set are hosed up. As you correctly indicated in your initial post. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 11:32 am Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
other interface takes care of the sap part which I am not working with. In my interface I just have to take in the message in text document and convert the message into different format required by other interface. |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 11:36 am Post subject: You probably need to use a SELECT statement to find all the |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
How do I use a SELECT statement here? Can you help me with that ? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 11:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
. In my interface I just have to take in the message in text document and convert the message into different format required by other interface. |
So this isn't a SAP document but a processed file? By "text document" do you mean each record is delimited by a <CR> or simply that it contains no binary data but remains fixed length is structure?
Better information, better advice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 11:40 am Post subject: Re: You probably need to use a SELECT statement to find all |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
How do I use a SELECT statement here? |
Try here
Broker wrote: |
Can you help me with that ? |
Of course. What hourly rate are you offering and where do we send the invoice?
Seriously, you could be well adviced to seek experienced WMB support on site (where they can see & understand your issue more clearly) rather than picking through advice being given by random strangers on the Internet. We've already established my advice in particular can be highly random...
Complex message sets tend not to be fun. _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Mon Mar 19, 2012 11:44 am; edited 1 time in total |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 11:43 am Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
Sorry for the confusion I gave. Its not sap Document, Its a text document with each field with fixed length of 94 characters and separated by <CR><LF>.
and also to mention each record had sub records like body has fields like record type, amount etc which I am assigning these using fixed length condition once I am able to differentiate header, body and trailer. |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 11:47 am Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
Sorry I just asked as I never used SELECT in such a case. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 11:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
Its a text document with each field with fixed length of 94 characters and separated by <CR><LF>. |
So the records in your WMQ message are not a fixed length of 94 characters long as you claimed; they're 96. Or they're delimited by <CR><LF> and not fixed length at all. This gives you a number of design options.
Broker wrote: |
also to mention each record had sub records like body has fields like record type, amount etc which I am assigning these using fixed length condition once I am able to differentiate header, body and trailer. |
I thank you for the additional information, but had correctly assumed that once you'd identified the record type you were using the message set to parse it rather than substringing through it in ESQL. Your method is unquestionably standard practice for this situation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 11:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
Sorry I just asked as I never used SELECT in such a case. |
Hence I supplied a link & the advice to seek more experienced help more locally based.
Advice I stand by. WMB is not a simple product, what you're parsing is not simple, your requirements are not simple. As a minimum, a 2nd pair of eyes could highlight an issue. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 12:03 pm Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
I can say they are delimited by <CR><LF> and are also fixed length of 94 characters including the tag excluding <CR><LF>.
Something like:
94 characters
94 characters
94 characters
I am not sure if this is the answer u wanted? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2012 12:12 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Broker wrote: |
I am not sure if this is the answer u wanted? |
It wasn't a question. You can either treat them as fixed length 96 byte records, or you can treat them as delimited. Hence my comment about "options". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Broker |
Posted: Mon Mar 19, 2012 12:19 pm Post subject: |
|
|
Novice
Joined: 19 Mar 2012 Posts: 22
|
OKI got it. If i treat as a delimited with <CR><LF> in this case. How do I specify in my message set to differentiate between body and trailer. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Mar 19, 2012 12:20 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Broker wrote: |
OKI got it. If i treat as a delimited with <CR><LF> in this case. How do I specify in my message set to differentiate between body and trailer. |
You tell it to use tags or group indicators or data patterns to resolve choices. |
|
Back to top |
|
 |
|