View previous topic :: View next topic
|
Author |
Message |
gayathrinag
New User
Joined: 16 Oct 2008 Posts: 37 Location: chennai
|
|
|
|
Hi,
I have a requirement that i need to compare the Alphanumeric field with numeric field.
Example:
WS-FIELD1 06 A
WS-FIELD2 06 N
if WS-FIELD1 = WS-FIELD2
then do something.
But we cannt compare these,since both are different datatypes. I need help in comparing this.
And in my WS-FIELD1 i may have leading zeros (say 000110).
Can any one help me in this.
Thanks |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What have you tried and what were the results ? |
|
Back to top |
|
|
gayathrinag
New User
Joined: 16 Oct 2008 Posts: 37 Location: chennai
|
|
|
|
i have tried the following things
1) we tried to move the WS-FIELD1 Alphanumeric field to Numeric field and we tried to compare them but we got s0c 7 abend. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Most likely, there's data in WS-FIELD1, positions 1-5, which has a low-order (numeric) nibble which exceeds X'9'. But, position-6 could be the culprit as well.
When the comparison is issued (under the covers), a "Compare Pack" instruction is generated. This is because the data found in both fields is PACKED (zone-nibbles are discarded, except for position-6) before the "CP" instruction. Bad packed-data will cause a "CP" to raise a S0C7.
Please post (in hex, IE: 0 = X'F0') all of the data found in both fields.
Bill |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What do these fields contain? Is the compare to determine if they are equal/unequal or something else?
If you show a few examples of the data and the result you want from a compare, we may be able to offer more suggestions. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
why don't you redefine/move the numeric field to an alpha field and compare the alpha fields.
if you have non-numerics in your numeric field, you screwed anyway.
you could always do the validatation/compare in sort. |
|
Back to top |
|
|
|