Author |
Message
|
manan.patel |
Posted: Tue Oct 09, 2012 4:50 am Post subject: Discard Input Record |
|
|
Apprentice
Joined: 01 Oct 2012 Posts: 25
|
I have used MRM parser for parsing of an input file.
However I have a requirement that based on the content of input, either i will be passing the message to the procedure in my esql file or i will simply discard it.
The problem is like
InputRoot.MRM.SXW_SEGMENT.SXW_STATION.SXW_CURR_CDE = "KM" then i need to discard the whole record before it could be parsed, otherwise it is adding a blank line in my output file which is "CSV".
Experts, please help. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 09, 2012 5:37 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
manan.patel |
Posted: Tue Oct 09, 2012 5:43 am Post subject: |
|
|
Apprentice
Joined: 01 Oct 2012 Posts: 25
|
Thanks for the reply..
But the thing is not that simple.
Even then after it is adding the blank line in my output file.
Here is my code.
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
IF variable = 'KZ' THEN
--do nothing that means, discard the record
ELSE
CALL FunctionToParseInput();
END IF;
RETURN TRUE;
END;
So if there is any otherway? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 09, 2012 5:48 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Use [c o d e ] tags in your forum posts, please.
There are several WMB consultants in the forum. Are you offering work? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 09, 2012 5:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
manan.patel wrote: |
So if there is any otherway? |
Well you could code it correctly.
If you want to discard any input record with variable = 'KZ' then you should discard it. Doing nothing is not the same as discarding it. All your code does is not parse it; the unparsed (presumably blank output) message is still sent out of the Compute node and into the FileOutput node where it builds this blank line.
Fix your code to actually discard the mesage and not send it onwards.
Hint: what makes the message move? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aravind703 |
Posted: Tue Oct 09, 2012 5:53 am Post subject: |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 09, 2012 5:54 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
aravind703 wrote: |
Try RETURN FALSE |
You are too easy. You need to make the noobs look up the information. Else, how will they learn? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
aravind703 |
Posted: Tue Oct 09, 2012 5:58 am Post subject: @ lancelotlinc |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
I am really sorry, i should have understood when my first post was deleted. I was not sure my i was not seeing my post.
So i did post a new one.
I will not post any directly solution from now on |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 09, 2012 6:01 am Post subject: Re: @ lancelotlinc |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
aravind703 wrote: |
I am really sorry, i should have understood when my first post was deleted. I was not sure my i was not seeing my post.
So i did post a new one.
I will not post any directly solution from now on |
Don't let him push you around. Maybe we're all cranky people who should be nicer and more directly helpful. Stand up to us, and tell us to be nicer if that's the right thing.
Of course, maybe if you hang around here long enough, you'll become a cranky person who should be nicer and more directly helpful from the overwhelming tide of questions that demonstrate no effort to solve or understand. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 09, 2012 6:14 am Post subject: Re: @ lancelotlinc |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
mqjeff wrote: |
a cranky person who should be nicer and more directly helpful. |
Hey, I resemble that remark. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 09, 2012 6:46 am Post subject: Re: @ lancelotlinc |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
lancelotlinc wrote: |
mqjeff wrote: |
a cranky person who should be nicer and more directly helpful. |
Hey, I resemble that remark. |
I resemble it far more, but I do think there's value in giving posters hints rather than just spoon feeding out answers.
Should we be giving more hints and being nicer? Maybe. Should we just accept that a) training is not available to everyone & b) doesn't answer every possible question, just most of the obvious ones? Yes.
Which in no way diminishes the value of formal training, the desireabliity of such training and acceptance that the world is not perfect. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 09, 2012 6:47 am Post subject: Re: @ lancelotlinc |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Of course, maybe if you hang around here long enough, you'll become a cranky person |
I give it 6 months.
mqjeff wrote: |
the overwhelming tide of questions that demonstrate no effort to solve or understand. |
Which tide seems to be higher lately. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
manan.patel |
Posted: Tue Oct 09, 2012 7:48 am Post subject: |
|
|
Apprentice
Joined: 01 Oct 2012 Posts: 25
|
aravind703
Thanks, it worked...  |
|
Back to top |
|
 |
manan.patel |
Posted: Wed Oct 10, 2012 2:39 am Post subject: |
|
|
Apprentice
Joined: 01 Oct 2012 Posts: 25
|
Jedi Knight wrote
Quote: |
You are too easy. You need to make the noobs look up the information. Else, how will they learn? |
Sorry, jedy..
But i disagree to you.
It was waste of time if I searched the information library for this silly thing.
Return False is not any technology that i must learn.
Forum is for helping the bugs like this.
And still you disagree than again I am sorry. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Oct 10, 2012 5:02 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
manan.patel wrote: |
Jedi Knight wrote
Quote: |
You are too easy. You need to make the noobs look up the information. Else, how will they learn? |
Forum is for helping the bugs like this.
|
"Bugs", like Freshers?
Do you mean to say that you choose not to do your own research and discover why your use of the product is not aligned with the design of the product?
RETURN FALSE is one of the most basic syntax elements of ESQL.
Why should someone help you if you won't even do your own homework?
Why should we allow you to copy off our homework assignment? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|