Author |
Message
|
shyamkumarsharma001 |
Posted: Mon Mar 11, 2013 6:56 am Post subject: Generating Output containing both ASCII and EBCDIC format |
|
|
 Novice
Joined: 24 May 2011 Posts: 18
|
Hi,
My requirement is to generate an output having Header and Body.
The header is required to be generated in ASCII format while the Body part should be generated in EBCDIC. Moreover the Body part contains some fields
which needs to be converted to packed decimal.
How can this be achieved?
I have created the output message set in which the header is Fixed length character. The Body has External Decimal, String and Packed Decimal data types.
The problem is Either it generates the whole data as ASCII or EBCDIC(when I set the CCSID as 37). How do I achieve the data containing both ASCII and EBCDIC.
Any Help is appreciated. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Mar 11, 2013 8:34 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
You can generate the body using ASBITSTREAM function with the appropriate CCSID. Then assign the result to the proper place in the logical message tree. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 11, 2013 9:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
lancelotinc is correct if you are using v7 ( with MRM ) and you cannot upgrade.
However, this is very easy using version 8 and the DFDL language. DFDL allows you to specify a text encoding for each element in your xsd. In most data formats the text encoding is the same throughout the document - but your data format appears to be one of the exceptions to that rule. |
|
Back to top |
|
 |
shyamkumarsharma001 |
Posted: Mon Mar 11, 2013 9:32 am Post subject: |
|
|
 Novice
Joined: 24 May 2011 Posts: 18
|
Thanks lancelotinc and Kimbert for your valuable response. I will implement it and let you know the result. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 11, 2013 10:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kimbert wrote: |
However, this is very easy using version 8 and the DFDL language. DFDL allows you to specify a text encoding for each element in your xsd. |
Oooo......... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shyamkumarsharma001 |
Posted: Thu Mar 14, 2013 6:59 am Post subject: |
|
|
 Novice
Joined: 24 May 2011 Posts: 18
|
Yes that helped.Thanks.
I created 2 BLOB variables A and B. In 1st I assigned the header and in the other I assigned the Body in BLOB Format.
At End I used
SET OutputRoot.BLOB.BLOB = A || B; and wrote the message as a BLOB.
I just wanted to know 1 thing:
Can we create a CWF message set(Output) with 1 field as BLOB and rest as Characters and parse the output against message set? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 14, 2013 7:18 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Can we create a CWF message set(Output) with 1 field as BLOB and rest as Characters |
Yes
Quote: |
and parse the output against message set? |
So you want to create 1 BLOB variable for the header using (using the character encoding of the header), then use the message set to write the header BLOB plus the rest of the character data.
Yes - that should work OK. |
|
Back to top |
|
 |
shyamkumarsharma001 |
Posted: Thu Mar 14, 2013 10:29 am Post subject: |
|
|
 Novice
Joined: 24 May 2011 Posts: 18
|
Yes Exactly.. But how to create the CWF message set with 1 BLOB field as we have only 4 physical types available
1. Fixed Length String
2. Length Encoded String1
3. Length Encoded String2
4. Null Terminated String
(There is no BLOB type)
What should be the type of that field to accommodate a BLOB data and write BLOB data without any conflict between String and BLOB while writing. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 14, 2013 12:39 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
we have only 4 physical types available |
Have you tried changing the schema type from xs:string to xs:hexBinary? |
|
Back to top |
|
 |
shyamkumarsharma001 |
Posted: Thu Mar 14, 2013 11:35 pm Post subject: |
|
|
 Novice
Joined: 24 May 2011 Posts: 18
|
Amazing that did the trick.
Thank you so much. I was searching for a BLOB data type without knowing that HexBinary is meant for the same thing. Bravo.
 |
|
Back to top |
|
 |
|