Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Comparing two alphanumeric variables containing numericvalue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Thu Jan 29, 2009 3:27 pm    Post subject: Comparing two alphanumeric variables containing numericvalue
Reply with quote

I have two alphanumeric fields, both have the numeric values in them. I want to compare those values.
for eg: consider var1 pic x(20) value '12345'
var2 pic x(20) value '999'

I tried to move them into numeric variables and compare. But it did not work.

The values in var1, var2 might contain decimal values also(eg:123.45,999.99)

Now how should i compare those values?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jan 29, 2009 4:53 pm    Post subject:
Reply with quote

Instead of MOVE use NUMVAL to convert from alpha to numeric and then compare your newly populated numeric fields.

an alpha picture will preclude algebraic compare.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To get Non matching row after compari... vinu78 DB2 7 Fri Jan 05, 2018 5:43 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Comparing dates in different formats migusd SYNCSORT 4 Sat Nov 18, 2017 3:02 am
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us