Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to compare Alpanumeric with Numeric Field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: How to compare Alpanumeric with Numeric Field
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: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 02, 2011 7:50 pm    Post subject:
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 02, 2011 8:14 pm    Post subject: Reply to: How to compare Alpanumeric with Numeric Field
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

Site Director


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

PostPosted: Wed Mar 02, 2011 9:25 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us