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 IndexWebSphere Message Broker SupportCreating a Cobol Comp-3 field from esql

Post new topicReply to topic Goto page Previous  1, 2
Creating a Cobol Comp-3 field from esql View previous topic :: View next topic
Author Message
bruce2359
PostPosted: Tue Jan 21, 2020 8:41 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8712
Location: US: west coast, almost. Otherwise, enroute.

rahulk01 wrote:

Now in one particular field, I have to set x'FF' and the CCSID being used is 1208. While casting, I am getting an error:
Text:CHARACTER:SET rFileTrailer.W_TRN_INDIKATOR = CAST(X'ff' AS CHARACTER CCSID 1208)

Hex 'ff' (lower-case) is different than hex 'FF' (upper-case).
_________________
My life flows on in endless song;
How can I keep from singing?
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue Jan 21, 2020 8:51 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1387

rahulk01 wrote:
My file is going to have to have header and a trailer record.
The first byte in the header record is supposed to contain Hex low value i.e. x00 and the first byte of the trailer record will contain hex high value i.e. xFF.
The field representing this byte in the DFDL parser is configured as a string of length 1 byte.

Wouldn't an unsignedByte be a better fit here, rather than a string?

rahulk01 wrote:
Code:
SET rFileTrailer.W_TRN_INDIKATOR = CAST(X'ff' AS CHARACTER CCSID 1208);

The 1208 is supposed to describe the BLOB literal X'FF'. It has no relation to whatever ccsids might be used to describe the unparsed input or output messages.

rahulk01 wrote:
Just curious to know if x'FF' is not part of CCSID 1208 characters.

No, it is not.

bruce2359 wrote:
Hex 'ff' (lower-case) is different than hex 'FF' (upper-case).

BLOB literals are not case-sensitive.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Jan 21, 2020 3:37 pm Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1116

To expand on the points made by rekarm01...

The basic problem is a combination of two factors:
- your DFDL model is treating these fields as CHARACTER fields
- You have decided to specify a variable-width CCSID for these fixed-width fields

You need to change one of those in order to solve your problem. I recommend that you change both because your model will not be safe otherwise.

a) change your DFDL model so that binary fields are modelled as xs:hexBinary (i.e. BLOB)
and
b) Specify a single-byte CCSID. ISO8859-1 is a safe choice because it has a character mapping for all 256 possible byte values. But that may not be the best choice for this flow - whatever CCSID you pick put some thought into it and be prepared to defend your decision with facts. If somebody complains that you should be using UTF-8, just refer them to this thread.

Obviously, you will also need to change your ESQL to put BLOB values into the indicator fields, not CHARACTER values.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum IndexWebSphere Message Broker SupportCreating a Cobol Comp-3 field from esql
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.