ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pipe Delimited file format with multiple records

Post new topic  Reply to topic
 Pipe Delimited file format with multiple records « View previous topic :: View next topic » 
Author Message
chenna.hari
PostPosted: Sun Mar 22, 2009 4:04 am    Post subject: Pipe Delimited file format with multiple records Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

Hi,

I have file format like this
a|b|c|d|e|f
a|b|c|d|e|f
..............
..............
..............
a|b|c|d|e|f

here values of a, b, c, d, e, f are any values i.e. different for different records.
And i need to separate the records based on the 'b' value.
like if 'b' value is less than 5, then need to send those records in one file and remaining records to other file.

like for example.

a|5|c|d|e|f
a|4|c|d|e|f
a|6|c|d|e|f
a|3|c|d|e|f

then the records
a|4|c|d|e|f
a|3|c|d|e|f
are need to send to one file
and the records
a|5|c|d|e|f
a|6|c|d|e|f are need to send to another file.

here MRM msgset is like this
Record
element1
element2
and ofcourse record will be repeative.

Here i need to store records for one condition in Environment variables so that i will assign this back to outputRoot and propagate.

can any one help how to store InputRoot.MRM.Record to Environment variables and assign back to OutputRoot.MRM.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Mar 22, 2009 4:42 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

What options/methods have you tried? (eg code)
Have you searched this Forum for simiar questions?
Have you read the product Documentation?
etc
We really want to help you help yourself. That way you will learn quicker.
_________________
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
View user's profile Send private message
chenna.hari
PostPosted: Sun Mar 22, 2009 7:25 pm    Post subject: Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

smdavies99 wrote:
What options/methods have you tried? (eg code)
Have you searched this Forum for simiar questions?
Have you read the product Documentation?
etc
We really want to help you help yourself. That way you will learn quicker.




I tried with example code like this
While
SET Environment.Variables.MRM.Record[RecordCount1].Element1 = InputRoot.MRM.Record[RecordCount].Element1;
--
---
END

and assigning back to OuputRoot like this.
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateContent, ValidateValue, ValidateLocalError);
DECLARE subBitStream BLOB
CAST(ASBITSTREAM(Environment.Variables.MRM.Record
OPTIONS parseOptions
SET 'MST'
TYPE 'CSV_Message/Record'
FORMAT 'Text1') AS BLOB);
IF subBitStream IS NOT NULL THEN
CREATE LASTCHILD OF OutputRoot.MRM
PARSE ( subBitStream
OPTIONS parseOptions
SET 'MST'
TYPE 'CSV_Message/Record'
FORMAT 'Text1');
END IF;


but iam not getting records in Output
Pls let me know whether process is correct or any wrong in this code
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Mar 22, 2009 10:29 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

May I suggest that you put a trace node after the Compute node and output the Environment tree.
You are copying a tree from the input into the environment and then start messing around with a BLOB when putting it back into the output tree.
Why do you think that this is the correct way to do it?
_________________
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
View user's profile Send private message
MQEnthu
PostPosted: Sun Mar 22, 2009 11:00 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

chenna.hari wrote:
Here i need to store records for one condition in Environment variables so that i will assign this back to outputRoot and propagate


Any perticular reason why do you want to store it in Environment tree before assigning it to Output tree?? And I understand that the ourtput message format remains same as input (same pipe delimited message), you just have to split the message based on the value in field 'b' but the basic message structure remains same... then why do you think you should write the output tree in blob?
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
chenna.hari
PostPosted: Mon Mar 23, 2009 7:50 pm    Post subject: Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

smdavies99 wrote:
May I suggest that you put a trace node after the Compute node and output the Environment tree.
You are copying a tree from the input into the environment and then start messing around with a BLOB when putting it back into the output tree.
Why do you think that this is the correct way to do it?



Here i need two files to be sent to two different servers. Here i can use two while loops to form two outputRoot. But iterations will be become twice as no of records in input file.... thats why i stored records for one condition in environment variables and remaiing records in Output.

any way Iam using this logic
Environment.RecordCount.Record[RecordCount].Element1 = InputRoot.MRM.Record[RecordCount1].Element1

SET OutputRoot.MRM = Environment.RecordCount

Its worked fine...

But what was the wrong in the way which i sent previously
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pipe Delimited file format with multiple records
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.