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

Comparing two alphanumeric variables containing numericvalue


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Thu Jan 29, 2009 4:53 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JCL with variables JCL & VSAM 1
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top