|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Issue with Variable length Mesg with Suppress Absent Element |
« View previous topic :: View next topic » |
Author |
Message
|
m.arunprasad1 |
Posted: Mon Feb 11, 2013 11:02 pm Post subject: Issue with Variable length Mesg with Suppress Absent Element |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi,
I am trying to define a Message Set which generates a CSV file and the structure will be as follows :
AgentHeader
TraderHeader
DataRecords
In the above, AgentHeader field is optional(it may occur or may not) and remaining will mandaortorily occur.
I am using a Variable Length Elements Delimited with the Suppress Absent Element Delimiter as 'End Of Type'
My issues is, whenever the AgentHeader is not populating, I am getting a new line feed is being populated in the beginning of output message which should not be there as per requirement.
Incorrect OutputMessage :
----> AgentHeader
T,445212,,Eleviver Ltd,X,D,123454,0512,CSV02, -----> TraderHeader
12345657,10,DDP,16,1,1,BET,1, ------> DataRecords
12345657,212,DDP,10,25,27,RDK,2,
Correct OutputMessage:
T,445212,,Eleviver Ltd,X,D,123454,0512,CSV02,
12345657,10,DDP,16,1,1,BET,1,
12345657,212,DDP,10,25,27,RDK,2,
Please help me implementing this.[/img] |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Feb 12, 2013 12:21 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Please let us know that version of broker you are using and what platform the runtime is on. _________________ 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 |
|
 |
m.arunprasad1 |
Posted: Tue Feb 12, 2013 12:36 am Post subject: Message Broker Version & Platform |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi smdavies99,
I am using IBM Websphere Message Broker Version 6.0.2 and I am running it on Windows Server 2003 Enterprise Edition Service Pack 2
Thanks. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Feb 12, 2013 1:03 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Oh dear.
you do know that V6.0.0.x went out of service years ago and that 6.0.0.2 is not even the last update to that version.
Many of those here are using V8 (fp 2 is due soon, well it should be anyway) and V7 is up to 7.0.0.5 and V6.1 (at FP11) is due to be retired in a few months.
I can only hope that where you are working is actively persuing an upgrade to your current version. _________________ 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 |
|
 |
m.arunprasad1 |
Posted: Tue Feb 12, 2013 1:15 am Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi smdavies99,
Thanks smdavies99 for the response.
I am aware that about the recent version, but our project is currently runnin only on this Version 6.0.0.2 and I know this is pretty old one, but cant help it.
Can anyone help me out in this case plz.
Thanks. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Feb 12, 2013 2:37 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
As pointed out by smdavies99, the support for this version of WMB is obsolete and hence you should push for version update ASAP.
For your query though, What is the Delimiter you have specified? Have you set the Min Occurs for AgentHeader as 0 and its value to be Nillable? |
|
Back to top |
|
 |
m.arunprasad1 |
Posted: Tue Feb 12, 2013 3:01 am Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi kash3338,
I have set
Data Elemenet Separation : Variable Length Elements Delimited
Delimiter : . (comma)
Suppress Absent Element Delimiter : EndOfType
Also, I have already set the Min Occur for Agent Header as 0 and set the value as Nillable and Encoding Null as 'NullLiteralValue' for its contents.
Thanks. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Feb 12, 2013 4:46 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Do you have a Root element with Data Elemenet Separation as Variable Length Elements Delimited, and the delimiter as '<CR><LF>'? |
|
Back to top |
|
 |
m.arunprasad1 |
Posted: Tue Feb 12, 2013 5:39 am Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi Kash3338,
I have the Root Element (AgentHeader) Data Element Separation as 'Variable Length Elements Delimited' and the Delimiter as ','(comma) as the AgentHeader values should be delimited with ','(comma).
My MessageSet is looking like this :
UK - Message
AgentHeader
TraderHeader
DataRecords
Complete MessageSet Structure:
UK (Data Ele Sep : Var Length ele delim and Delimiter is <CR><LF> and Suppress Abs Ele Delimt is 'EndOfType')
AgentHeader(Data Element Separation as 'Variable Length Elements Delimited' and the Delimiter as ','(comma) and Supp Abs Ele Delim is 'EndOfType')
TraderHeader(Data Element Separation as 'Variable Length Elements Delimited' and the Group Terminator is ','(comma) and Delimiter as ','(comma) and Supp Abs Ele Delim is 'Never')
DataRecords(Data Element Separation as 'Variable Length Elements Delimited' and the Group Terminator is ','(comma) and Delimiter as ','(comma) and Supp Abs Ele Delim is 'Never')
I have already shared the sample message without AgentHeader and here is the one with AgentHeader:
A,714775323,,ASKEDF,,,,,CSV02 ----> AgentHeader
T,445212,,Eleviver Ltd,X,D,123454,0512,CSV02, -----> TraderHeader
12345657,10,DDP,16,1,1,BET,1, ------> DataRecords
12345657,212,DDP,10,25,27,RDK,2, |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 12, 2013 7:51 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
DFDL makes this easier...for v8 users
However, if you don't want the separator for the header unless the header is present then you should
- remove the delimiter from the outer complex type
- define a group terminator for the header element. The group terminator will only be written if the header is present in the message tree.
- enclose the rest of the message definition in a local sequence group that has the same TDS delimiter as the complex type used to have. |
|
Back to top |
|
 |
m.arunprasad1 |
Posted: Tue Feb 12, 2013 10:59 pm Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi Kimbert,
Thanks for the response. Can you please be specific on the outer complex type, header element here as it is confusing for me.
My Message Structure is:
UK ---->MessageType
AgentHeader
TraderHeader
DataRecords
And in my ESQL Code, I have written as follows :
--Agent Header Record -Optional if AGD_Active = 'TRUE' ie 1
IF(TransactionRef.AGD_Active)THEN
SET OutputRoot.MRM.AgentHeader[i].AgentFlag = TransactionRef.INA_AgentDefined1;
SET OutputRoot.MRM.AgentHeader[i].AgentVATNumber = TransactionRef.INA_AgentVATno;
SET OutputRoot.MRM.AgentHeader[i].AgentBranchId = TransactionRef.INA_BranchID;
SET OutputRoot.MRM.AgentHeader[i].AgentName = TransactionRef.INA_AgentName;
SET OutputRoot.MRM.AgentHeader[i].NotUsed1 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed2 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed3 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed4 = '';
SET OutputRoot.MRM.AgentHeader[i].VersionIdentification = TransactionRef.INA_AgentDefined2;
END IF;
Please  |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Feb 13, 2013 1:30 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
m.arunprasad1 wrote: |
Code: |
SET OutputRoot.MRM.AgentHeader[i].NotUsed1 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed2 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed3 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed4 = '';
|
|
When you have this set of code, how do you say,
m.arunprasad1 wrote: |
My issues is, whenever the AgentHeader is not populating, I am getting a new line feed is being populated in the beginning of output message which should not be there as per requirement. |
I guess this is why you are getting the AgentHeader getting created everytime. When you dont want the field, why do you map it? |
|
Back to top |
|
 |
m.arunprasad1 |
Posted: Wed Feb 13, 2013 2:56 am Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi Kash3338,
As per my ESQL Code,
Code: |
--Agent Header Record -Optional if AGD_Active = 'TRUE' ie 1
IF(TransactionRef.AGD_Active)THEN
SET OutputRoot.MRM.AgentHeader[i].AgentFlag = TransactionRef.INA_AgentDefined1;
SET OutputRoot.MRM.AgentHeader[i].AgentVATNumber = TransactionRef.INA_AgentVATno;
SET OutputRoot.MRM.AgentHeader[i].AgentBranchId = TransactionRef.INA_BranchID;
SET OutputRoot.MRM.AgentHeader[i].AgentName = TransactionRef.INA_AgentName;
SET OutputRoot.MRM.AgentHeader[i].NotUsed1 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed2 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed3 = '';
SET OutputRoot.MRM.AgentHeader[i].NotUsed4 = '';
SET OutputRoot.MRM.AgentHeader[i].VersionIdentification = TransactionRef.INA_AgentDefined2;
END IF;
|
I will be generating the Output AgentHeader Message only when AGD_Active field(From Database) is set as '1' and now what is happening is when AGD_Active is '0' I am getting a newline character which not our requirement. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 13, 2013 3:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
well, you need to understand the MRM concepts - otherwise we cannot explain the solution. Please explain what you have tried ( after my last answer ) and exactly what you do not understand.
Also, please use code tags around your ESQL - it will make your posts a lot more readable for us. |
|
Back to top |
|
 |
m.arunprasad1 |
Posted: Wed Feb 13, 2013 6:15 am Post subject: |
|
|
Novice
Joined: 11 Feb 2013 Posts: 19
|
Hi Kimbert,
My MessageSet is looking like this :
UK ---------->(MessageType)
AgentHeader
TraderHeader
DataRecords
- remove the delimiter from the outer complex type
I HAVE REMOVED THE DELIMITER <CR><LF> from the Header Element AgentHeader
- define a group terminator for the header element. The group terminator will only be written if the header is present in the message tree.
I HAVE ASSIGNED A GROUP TERMINATOR FOR THE AgentHeader AS <CR><LF>
- enclose the rest of the message definition in a local sequence group that has the same TDS delimiter as the complex type used to have.
The rest of the message definition has the same TDS delimiter as the complex type.
Here, I want the clarification on removing the delimiter from outer complex type(it denotes the AgentHeader or the UK) ? |
|
Back to top |
|
 |
|
|
 |
Goto page 1, 2 Next |
Page 1 of 2 |
|
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
|
|
|
|