|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
COBOL copy book REDEFINES question |
« View previous topic :: View next topic » |
Author |
Message
|
Ching |
Posted: Thu Jan 06, 2005 10:53 am Post subject: COBOL copy book REDEFINES question |
|
|
 Apprentice
Joined: 08 Nov 2004 Posts: 25 Location: Portland, OR
|
Hi everyone,
I'm having problems using the REDEFINES in my COBOL copy book.
I'm trying to go from MRM -->XML data.
Here is my copy book:
01 RECORD.
05 RECID PIC X(02).
05 HDRREC.
10 HDRFIELD1 PIC X(01).
10 HDRFIELD2 PIC X(01).
05 DTLREC REDEFINES HDRREC PIC X(02).
In my test input file all I have is:
abcd
---------------------------------------------------
This is what I would expect the values to be:
RECID = ab
HDRFIELD1 = c
HDRFIELD2 = d
DTLREC = cd
----------------------------------------------------
Here is a snippet of my code:
DECLARE A CHARACTER;
DECLARE B CHARACTER;
DECLARE C CHARACTER;
DECLARE D CHARACTER;
SET A = InputRoot.MRM.RECID; --ab
SET B = InputRoot.MRM.HDRREC.HDRFIELD1; --c
SET C = InputRoot.MRM.HDRREC.HDRFIELD2; --d
SET D = InputRoot.MRM.DTLREC; --should be cd
SET OutputRoot.XML.DATA.A = A;
SET OutputRoot.XML.DATA.B = B;
SET OutputRoot.XML.DATA.C = C;
SET OutputRoot.XML.DATA.D = D;
-----------------------------------------------------------------------
Here is my output:
<DATA>
<A>ab</A>
<B>c</B>
<C>d</C>
</DATA>
I'm not sure what happened to the 'D' tag. It is never mapped.
It should have the value 'cd' right?
I'm expecting this as the output:
<DATA>
<A>ab</A>
<B>c</B>
<C>d</C>
<D>cd</D>
</DATA>
I've created the message set(based on the copybook) and the mappings for all the fields are correct, except the REDEFINED field.
Any help would be appreciated.
Thanks!
Ching |
|
Back to top |
|
 |
JT |
Posted: Thu Jan 06, 2005 1:48 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Read up on the Composition property Choice.
The first reference in your ESQL code to one of the choice elements resolves the choice to the option that contains that element, thus when you referenced InputRoot.MRM.HDRREC, the parser doesn't recognize any remaining choices, in your case, InputRoot.MRM.DTLREC. |
|
Back to top |
|
 |
Ching |
Posted: Tue Feb 08, 2005 10:04 am Post subject: |
|
|
 Apprentice
Joined: 08 Nov 2004 Posts: 25 Location: Portland, OR
|
Hi JT,
Where exactly do you specify the 'composition property'? Is it somewhere
in the message set? A node? I've been looking through the IBM documentation, but I can't find it.
Thanks,
Ching |
|
Back to top |
|
 |
JT |
Posted: Tue Feb 08, 2005 11:25 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|