Author |
Message
|
chaitu |
Posted: Wed Aug 05, 2015 1:46 am Post subject: Generating multiple file from single input |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hello All,
I am trying to generate multiple records from single input.
suppose i have 10 records in my input and on that i have 4 set of repeated records then i have to generate 4 files with dynamic file names which i generating in compute. So my flow is like
MQi/p>>>compute>>>fileout(wired to in)
I am able to generate 4 files and placing them in local ftp location after that the while loop ended and go return true statement and again go to fileo/p node and failling their because empty file name error. My question is how to stop the flow without going to fileo/p after placing 4 file. can any one help me to figure it out.
Thanks.  |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Aug 05, 2015 3:19 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Did you use a PROPAGATE statement inside your while loop? _________________ 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 Aug 05, 2015 5:03 am Post subject: Re: Generating multiple file from single input |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
chaitu wrote: |
can any one help me to figure it out. |
Put RETURN FALSE at the end of the Compute node not RETURN TRUE.
The Compute module is a function that returns a Boolean. If true, it propagates the OutputRoot to the Out terminal (which is probably empty given your logic). If false, it does not. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
chaitu |
Posted: Thu Aug 06, 2015 1:05 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hello Vitor and smdavies99,
Yes I tried with the propagate and RETURN FALSE before posting this in blog but, no use.
Now i used if condition along with PROPAGATE and RETURN FALSE now working.
.
.
.
IF OutputLocalEnvironment.Destination.File.Name IS NOT NULL THEN
PROPAGATE;
END IF;
END;
END MODULE;
Thanks a lot. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 06, 2015 4:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should reconsider using a WHILE loop - especially if you're using [n].
Use a FOR loop. It's much easier and safer and less coding.
Your IF statement doesn't necessarily make sense. If you know when you are populating OutputLocalEnvironment.Destination.File.Name, then you should be doing your PROPAGATE from there.
Perhaps if you showed the entire compute module, - or at least most of it removing any large set of SET statements that work with the *Root trees for business data - then you could get more targeted help that is better suited to your code. |
|
Back to top |
|
 |
|