|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Create Multiple Lines in a File Based on Cobol CopyBook |
« View previous topic :: View next topic » |
Author |
Message
|
Vijay.Gopu |
Posted: Thu Jan 13, 2011 11:45 am Post subject: Create Multiple Lines in a File Based on Cobol CopyBook |
|
|
Newbie
Joined: 13 Jan 2011 Posts: 1
|
Dear All,
I am new to MQ/MB world, but i have the following requirement, I would like to know if it is possible in doing in MB.
I have a XML message and with in it have lets say 2 complex elements in which there could be repeatable element.
<xml>
<xs:element name=a type=AX>
<xs:element name=b type=BX maxOccurs=unbounded>
</xml>
Now i have a cobol copy book format with the following levels
and assume my level 30 record is repeatble.
Would it be possible for me to create a file in the below format?
010
030
030
030
The question here is can i create lines one by one/ one below the other.
Can this be done in MB?
000260 01 RECORD-010-C810.
000270 05 010HDR-LVL-CD PIC X(03).
000280 88 HEADER-RECORD VALUE '010'.
000290 05 010AX-NAME PIC X(25).
000300 10 010AX-NAME-FNAME PIC X(15).
000310 10 010AX-NAME-LNAME PIC X(10).
000973*
000974 01 RECORD-030-C810.
000980 05 030HDR-LVL-CD PIC X(03).
000990 88 POT-RECORD VALUE '030'.
000991 05 030BX-ADDR1 PIC X(25).
000997 05 030BX-ADDR2 PIC X(02).
001800*
Your Comments are welcome.
Please let me know.
Regards,
Vijay |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 13, 2011 11:49 am Post subject: Re: Create Multiple Lines in a File Based on Cobol CopyBook |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vijay.Gopu wrote: |
Can this be done in MB? |
Yes. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 14, 2011 2:21 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You need to
- create a message set
- add a TDS physical format
- create a empty message definition file
- add a message in which the outermost complex type has Data Element Separation set to 'Tagged Fixed Length'.
- add local elements for your "a" and "b", and set Group Terminator on both to '<CR><LF>'
- add child elements to "a" and "b".
- on the complex type of "a" set Data Element Separation to 'Fixed Length'
- set the TDS length property on each child of "a"
- on the complex type of "b" set Data Element Separation to 'Fixed Length'
- set the TDS length property on each child of "b"
Then, in a Compute node,
Code: |
SET OutputRoot.MRM = InputRoot.XMLNSC.xml; |
...and the MRM parser will do the rest for you when the message arrives at an output node.
btw, if your root tag name is not really 'xml' ( and I hope it is not) then make sure you change 'InputRoot.XMLNSC.xml' to reflect the real name of the root tag. |
|
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
|
|
|
|