Author |
Message
|
kiran26 |
Posted: Tue Dec 17, 2002 1:05 am Post subject: COBOL CopyBook Redefines help |
|
|
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 |
|
 |
kirani |
Posted: Tue Dec 17, 2002 7:22 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
|
Back to top |
|
 |
kiran26 |
Posted: Wed Dec 18, 2002 8:29 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Fri Dec 20, 2002 8:53 am Post subject: |
|
|
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 |
|
 |
kiran26 |
Posted: Fri Dec 20, 2002 9:22 am Post subject: |
|
|
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 |
|
 |
kiran26 |
Posted: Mon Dec 23, 2002 8:22 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Thu Dec 26, 2002 9:56 am Post subject: |
|
|
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 |
|
 |
|