Author |
Message
|
rohank84 |
Posted: Tue Feb 10, 2009 11:39 pm Post subject: get message seperated by enter key |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi all
i have a message file where there are data in each row ......i have to get these 4 rows ....these 4 rows are first 4 rows of the file .....mentioned below
TOTAL Messages : 44
AMOUNT : 250000
KEY : 125-562
DATE : 11-JAN-2009
i need to get these 4 rows in 4 seperated variables like
Var1 = TOTAL Messages : 44
Var2 = AMOUNT : 250000
Var3 = KEY : 125-562
Var4 = DATE : 11-JAN-2009
how can i do that ...i tried to get the position of '\n' but it returns 0.....is there a way to do this.... |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 11, 2009 12:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
rohank84 |
Posted: Wed Feb 11, 2009 12:49 am Post subject: |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi jeff ....thanks for this link ...its really very good....but im using BLOB message domain ...so wont be able to use MRM and the message sets....is there any other way of doing it |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 11, 2009 1:03 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Why would you possibly use the BLOB domain when you have the MRM to do it for you? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 11, 2009 1:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rohank84 wrote: |
im using BLOB message domain |
So you've paid for WMB (not a cheap piece of software) and have determined not to use one of the key product features?
I'd be interested in your requirement here, and also the cost/benefit case you used to justify the purchase. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rohank84 |
Posted: Wed Feb 11, 2009 1:37 am Post subject: |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi jeff ..the code is a part of a project so cannot really change the domain....this may be used in sub flow or some way else......so im sorry but cnt change the domain......is there ant other way fo doing it.....
hi vitor i know WMB is a costly and have plenty of features which are helpful ....but there is somethn called as project requirement which certainly cannot be changed according to you.....i hope u understand...if u know how to do this in BLOB domain then give the answer..... |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 11, 2009 1:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rohank84 wrote: |
this may be used in sub flow or some way else |
What has the use in sub-flow got to do with the domain? It's very unlikely the principle flow will be using BLOB (unless there's a site policy not to use the features of the product) so you'd need to reparse it anyway.
Also how will an externally fed flow be used as a sub-flow?
rohank84 wrote: |
there is somethn called as project requirement which certainly cannot be changed according to you.....i hope u understand |
I know I can't change the requirement, but if I understand the requirement I might be able to suggest an alternative that will work.
And "we're using BLOB because the project uses BLOB" is not a requirement, but a piece of circular logic. What has brought the project to devise a requirement to use BLOB? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rohank84 |
Posted: Wed Feb 11, 2009 2:03 am Post subject: |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi vitor ....saying again that i cant change the domain...i just gave an example that it might be used in sub flow or the other....what i am making is a just a small part of a project ....i really dont know how this is goin to be used in the project ....i guess we shud concentrate on solving the problem.... |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 11, 2009 2:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
hi jeff ..the code is a part of a project so cannot really change the domain |
You can change the domain with an RCD node. This is standard practice. You and your project leadership should know that.
Quote: |
....this may be used in sub flow or some way else......so im sorry but cnt change the domain |
Yes, you can. If some other part of the flow needs the message as a BLOB, then you can convert the message tree to a BLOB using ASBITSTREAM whenever you need to. If you always want the original input BLOB, use ASBITSTREAM on InputBody.BLOB at the start of the flow and save the resulting BLOB in the Environment tree.
Quote: |
......is there ant other way fo doing it..... |
Using the BLOB domain to parse a tagged delimited message is not best practice - in fact, it is very bad practice. Please take the advice being offered. Create a message set and use the MRM domain to parse your Tagged Delimited message. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Feb 11, 2009 2:12 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
..the code is a part of a project so cannot really change the domain. |
If you are writing a subflow then all that the people calling are concerned with is the inputs and the outputs. What you do inside to acheive your requirements is usyally up to the developer.
There is nothing to stop you:-
Saving the complete input message into the environment
Parse it as a simple TDS
Do whatever you need to the data
Restore the original message if need be
Trying to do this as a BLOB is going to be
Messy
Slow
Almost impossible to make changes to
going to take several times longer that if you were going to do it as a TDS message
If you are reading the message from a queue then why can't you read it as a TDS message? It is not as if the data is going to change between reading is as a BLOB. it is only the format. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 11, 2009 2:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rohank84 wrote: |
i guess we shud concentrate on solving the problem.... |
I'm forced to pedantically point out this is your problem, i.e. a problem you are employed to solve. I'm doing this from a spirit of fellowship and as a distraction from the problems I'm employed to solve. Many of which can't be solved unless I can raise the average IQ of this building about 40 points. Oh well.
As to your problem, you have a requirement to extract individual records from a BLOB domain. This domain, by it's nature, is opaque to the broker and treated as a non-differentiated stream. Hence things like POSITION don't work as the broker can't see the message contents. You'll need to devise a method of separately parsing the data so that you can break it up as you require. I'd suggest as a starting point seeing how the rest of your project is accessing this BLOB data; there should be something developed there you can either leverage, or use as a starting point.
Do post your solution when you come up with it; I for one am genuinely interested how you'll get out of this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rohank84 |
Posted: Mon Feb 16, 2009 4:33 am Post subject: |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi guys i solved it ...X'0d0a' is the code for enter key ...used substring to get the string ....
thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 16, 2009 5:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rohank84 wrote: |
hi guys i solved it ...X'0d0a' is the code for enter key ...used substring to get the string ....
thanks |
Bad practice. You should use the mnemonics.
What happens when you are not on a windows platform?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rohank84 |
Posted: Mon Feb 16, 2009 9:50 pm Post subject: |
|
|
Centurion
Joined: 31 Dec 2008 Posts: 109
|
hi saper ....why wont it work on other platforms .....its a hexadecimal string that im using ....so it will same for every OS .... |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 16, 2009 10:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rohank84 wrote: |
hi saper ....why wont it work on other platforms .....its a hexadecimal string that im using ....so it will same for every OS .... |
xodoa is CRLF on a windows platform. This is not the same on a Unix platform where you may only see LF. Don't know what it would be on an EBCDIC platform... so yes it might be the same as long as you don't have to translate your bytestream into characters... Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|