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 » Change DFDL Encoding.

Post new topic  Reply to topic
 Change DFDL Encoding. « View previous topic :: View next topic » 
Author Message
leopucci
PostPosted: Thu Nov 09, 2017 4:19 am    Post subject: Change DFDL Encoding. Reply with quote

Apprentice

Joined: 09 Nov 2017
Posts: 28

Hello guys, how have you been?

I am having some trouble to cast a DFDL message to another encoding.

I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked

The thing is that there are some hex info that i need to maintain, so i was wondering two things:

1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?

2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol


Thanks for your help!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Nov 09, 2017 5:43 am    Post subject: Re: Change DFDL Encoding. Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

leopucci wrote:
Hello guys, how have you been?

I am having some trouble to cast a DFDL message to another encoding.

I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked

The thing is that there are some hex info that i need to maintain, so i was wondering two things:

1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?

2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol


Thanks for your help!

Probably none of the above. From your description of the problem it seems like you may have some binary fields that are not defined as such in your DFDL. I say go back to your DFDL definition and fix it!.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
leopucci
PostPosted: Thu Nov 09, 2017 10:55 am    Post subject: Re: Change DFDL Encoding. Reply with quote

Apprentice

Joined: 09 Nov 2017
Posts: 28

Thanks for your help Saper, the bits are ok and defined as hex! can you help me understand which command in esql i need to make to cast the message?
I have tried to set OutputRoot.Properties.CodedCharSetId but after that the message did not changed.

Thanks again!

fjb_saper wrote:
leopucci wrote:
Hello guys, how have you been?

I am having some trouble to cast a DFDL message to another encoding.

I´ve tried the OutputRoot.Properties.CodedCharSetId, and also changing the code page of the dfdl itself. Nothing worked

The thing is that there are some hex info that i need to maintain, so i was wondering two things:

1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdl´s? For instance, two equal dfdl structures, and use diferente code pages on it?

2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let´s name it "Selective cast" lol


Thanks for your help!

Probably none of the above. From your description of the problem it seems like you may have some binary fields that are not defined as such in your DFDL. I say go back to your DFDL definition and fix it!.
Back to top
View user's profile Send private message
timber
PostPosted: Thu Nov 09, 2017 4:00 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
I've tried the OutputRoot.Properties.CodedCharSetId
That will set a DFDL variable ${dfdl:encoding}. If you are using that variable in your DFDL schema then it will affect the output of the DFDL serializer. Otherwise it will have no effect at all.

Quote:
and also changing the code page of the dfdl itself
That's ambiguous - what specific part of the DFDL schema did you edit?

Quote:
1 - Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it?
Yes. That's the only solution that can possibly work. Every element in a DFDL schema has the property 'Encoding'. Usually, it gets set to a fixed value in the global format block, and every character field inherits that value. If the format block uses "${dfdl:encoding}" then it will pick up the encoding from the Properties tree.

Quote:
2 - IF not, can i cast the dfdl entirely on esql but leave some fields on hexbinary? Let's name it "Selective cast" lol
lol indeed! How exactly do you think ESQL's CAST function could work out which parts of the BLOB should be converted and which parts should be left alone?
Only a message model can supply that information - hence the answer above.
Back to top
View user's profile Send private message
timber
PostPosted: Thu Nov 09, 2017 4:05 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Just realised that my previous answer could be misunderstood...
Quote:
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it?
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema.
Back to top
View user's profile Send private message
leopucci
PostPosted: Fri Nov 10, 2017 12:57 pm    Post subject: Reply with quote

Apprentice

Joined: 09 Nov 2017
Posts: 28

Thank you timber.
You and saber are both right.

The fact is that the DFDL that i am testing (ISO8583) does not have the encoding property defined.
I have just created one using wizard as you explained and found the encoding variable.
Now i can move forward.
Thank you very much for the help!

timber wrote:
Just realised that my previous answer could be misunderstood...
Quote:
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it?
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema.
Back to top
View user's profile Send private message
leopucci
PostPosted: Fri Nov 10, 2017 2:29 pm    Post subject: Reply with quote

Apprentice

Joined: 09 Nov 2017
Posts: 28

Timber,
I have just tried the dynamic encoding.

Now i am able to see this dynamic encoding term on the dfdl editor.
It seems that i am not being able to understand the toolkit way of dealing with it.
I have created a message with the charset defined as ascii, then at the bottom of the esql, changed to ebcdic.

I think that it wil be necessary to send to a second node, before changing the charset. Am I correct?

Or it is possible to make the conversion in the same node?


Thanks in advance!

leopucci wrote:
Thank you timber.
You and saber are both right.

The fact is that the DFDL that i am testing (ISO8583) does not have the encoding property defined.
I have just created one using wizard as you explained and found the encoding variable.
Now i can move forward.
Thank you very much for the help!

timber wrote:
Just realised that my previous answer could be misunderstood...
Quote:
Can i convert 1 dfdl to another and let the dfdl do the code page conversion between two dfdls? For instance, two equal dfdl structures, and use diferente code pages on it?
You don't need 2 DFDL schemas. You need one DFDL schema that makes use of the ${dfdl:encoding} variable. Fortunately, all schemas generated by the wizards in the IIB toolkit are set up this way. You may not be able to use those wizards for your format, but you can create a dummy schema to see how it's done, and then follow the recipe in your own DFDL schema.
Back to top
View user's profile Send private message
timber
PostPosted: Sat Nov 11, 2017 3:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Would you mind posting some code - I'm struggling to understand the latest problem.
Back to top
View user's profile Send private message
leopucci
PostPosted: Tue Dec 26, 2017 3:18 am    Post subject: Reply with quote

Apprentice

Joined: 09 Nov 2017
Posts: 28

timber wrote:
Would you mind posting some code - I'm struggling to understand the latest problem.


Thanks Timber for your help. After fighting with the dfdl on the notepad i have found some encoding definitions that was wrong. After removing it, it worked!
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 » Change DFDL Encoding.
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.