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 » COBOL CopyBook Redefines help

Post new topic  Reply to topic
 COBOL CopyBook Redefines help « View previous topic :: View next topic » 
Author Message
kiran26
PostPosted: Tue Dec 17, 2002 1:05 am    Post subject: COBOL CopyBook Redefines help Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

Hi all,
My cobol copybook has fields like below.

field-1 pic x(5).
field-2 redefines field-1 pic 9(9) comp-3.

In the above case how can I know if I am getting the numeric value or character(Field-1 is character).So that i can map it to the output XML element.
Thanks
vishnu
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Dec 17, 2002 7:22 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

answered in this thread,
http://www.mqseries.net/phpBB2/viewtopic.php?t=6528&highlight=field2
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kiran26
PostPosted: Wed Dec 18, 2002 8:29 am    Post subject: Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

kiran,
Is there any other way to handle redefines other than handling by checking for sign nibble in a COMP-3 field. One more thing to notice is i am not getting any data from Mainframe which contains a field about the type of the field.How to get the sign nibble from the last byte of the COMP-3 filed. Thanks for your reply.

Thanks
vishnu
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Dec 20, 2002 8:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Vishnu,

I cannot think of any other way to do this.
Let's say you have a 2 byte comp3 field, the hex values for this field will look like this X'aaaZ', where a is any hex digit and Z is signed nibble. In order to check for last/signed nibble, you should read input message as BLOB in MQInput node, then use SUBSTRING function to get signed nibble from COMP-3 field and then compare it with C, D or F.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kiran26
PostPosted: Fri Dec 20, 2002 9:22 am    Post subject: Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

Thanks a lot Kiran.I have posted one more topic and the name of the topic is "Converting coded xml like < to real xml" . Its one first page only can u reply for that.

Thanks
vishnu.
Back to top
View user's profile Send private message
kiran26
PostPosted: Mon Dec 23, 2002 8:22 am    Post subject: Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

Kiran,
If i do SUBSTRING on X'aaaz' i get X'az'. How to do Substring for on X'az' to find the signed nibble. If i do SUBSTRING(X'aaaz' from 2 for 1) i always get X'az'. My question is how to do a substring on the signed nibble.
Thanks
vishnu
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Dec 26, 2002 9:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Vishnu,
I'd recommend that you make use of BITAND function to get the signed nibble.

Let's say your binary data is X'aaaz'. In First step you would get the last byte (X'az') by doing a SUBSTRING on the source data. Then use BITAND function on X'az' (last byte) and X'0F', which will give you (X'0z'). Finally compare this BLOB data with X'0C', X'0D' or X'0F' to see whether or not it is a COMP-3 field.

If the BITAND function does not accept BLOB as a parameter then use CAST .. CCSID function to CAST BLOB to INT.

Hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » COBOL CopyBook Redefines help
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.