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
 

 

Regarding Compare, how 65 > 55

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

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Fri Feb 01, 2008 1:11 pm    Post subject: Regarding Compare, how 65 > 55
Reply with quote

Hi All,
I i have one element a pic x(30) and second also b pic x(30) and i am comparing both as
if a < b
display 'Y'
Else
display 'N'

In my case a = 0000000000650000 and b = 55
but compare is passing and displaying 'Y', could anyone let me know how as 65 > 55 so it should display 'N'.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Fri Feb 01, 2008 1:14 pm    Post subject: Reply to: Regarding Compare.
Reply with quote

read the considerations for the comparison of chars

the content of the two filds might be left aligned, so ...
"00......" is certianly less than "55....."
Back to top
View user's profile Send private message
jackal
Currently Banned

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Fri Feb 01, 2008 1:21 pm    Post subject: Reply to: Regarding Compare.
Reply with quote

Thanks enrico...
so either of two....
1)0000000000650000 and 0000000000550000
or
2)65 and 55
right???
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Fri Feb 01, 2008 1:23 pm    Post subject: Reply to: Regarding Compare.
Reply with quote

Yes !

for char variables it is Your responibility to provide the proper alignement
and format consistency
Back to top
View user's profile Send private message
mnnarayankar

New User


Joined: 21 Jan 2008
Posts: 24
Location: bangalore

PostPosted: Mon Feb 04, 2008 1:19 pm    Post subject:
Reply with quote

Hi Jackal,


If u consider as a Alphabetic and Alphanumeric,
then both are the left justified field.

and Numeric is the Right justified.

As per your doubt



a pic x(30)
a = 0000000000650000


b pic x(30)
b = 55

if a < b
display 'Y'
Else
display 'N'

ya its true B > A

because A=55 and A=00

means A < B

Ans is 'Y'.
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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts fuzzy compare Martylin JCL & VSAM 9 Thu Mar 30, 2017 2:45 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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