IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to compare Alpanumeric with Numeric Field


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gayathrinag

New User


Joined: 16 Oct 2008
Posts: 37
Location: chennai

PostPosted: Wed Mar 02, 2011 7:41 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Mar 02, 2011 7:50 pm
Reply with quote

What have you tried and what were the results ?
Back to top
View user's profile Send private message
gayathrinag

New User


Joined: 16 Oct 2008
Posts: 37
Location: chennai

PostPosted: Wed Mar 02, 2011 7:57 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 02, 2011 8:14 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 02, 2011 9:25 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 03, 2011 12:30 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top