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
 

 

comparing 2 numbers in cobol without using If statement

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

New User


Joined: 11 Sep 2008
Posts: 3
Location: india

PostPosted: Sat Oct 11, 2008 9:30 am    Post subject: comparing 2 numbers in cobol without using If statement
Reply with quote

I want to write a cobol code for comparinig 2 numbers but not to use any if condition. can anyone crack this?????
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: Sat Oct 11, 2008 9:37 am    Post subject:
Reply with quote

Hello and welcome to the forum,

You could use EVALUATE.
Back to top
View user's profile Send private message
umesh khadaria

New User


Joined: 11 Sep 2008
Posts: 3
Location: india

PostPosted: Sat Oct 11, 2008 11:00 am    Post subject:
Reply with quote

I dont want to use any conditions. is there any code so that by using on compute verb we can do this.
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: Sat Oct 11, 2008 11:08 am    Post subject:
Reply with quote

Hello,

Maybe it will help if you describe exactly what you are wanting to accomplish.

Quote:
I dont want to use any conditions.
Of course you do - if we can believe your original post.
Quote:
code for comparinig 2 numbers
.

If you are playing some technical puzzle game, it would be good to mention this. This is most likely not for any business requirement.

Once we understand better, we may be able to provide other suggestions.
Back to top
View user's profile Send private message
umesh khadaria

New User


Joined: 11 Sep 2008
Posts: 3
Location: india

PostPosted: Sat Oct 11, 2008 12:45 pm    Post subject:
Reply with quote

sure its a technical puzzle...
suppose i have 2 numbers A and B.
i want to find out which is greater. i cant use IF and Evaluate Statement.
one way i had found is sort them in a file and check there occurence.
is there any arithmatic computation by which we can achieve this..
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Sat Oct 11, 2008 3:44 pm    Post subject: Reply to: comparing 2 numbers in cobol without using If stat
Reply with quote

... at the end of the string, You will find some kind of comparison,
( sort will have to compare things )

the only way to get away with it, given that the numbers are in the proper format,
is good old assembler, many arithmetic and load operations operation will set the condition code

I' ll leave to You to find out all the different behaviors,
two positive, two negatives, one of each
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Sat Oct 11, 2008 3:47 pm    Post subject: Reply to: comparing 2 numbers in cobol without using If stat
Reply with quote

if it is a puzzle, You should have posted in a different forum
and be ready after a while to post also the answer....
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: Sat Oct 11, 2008 3:56 pm    Post subject:
Reply with quote

Maybe HOMEWORK is a better description of the thread.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Oct 11, 2008 10:17 pm    Post subject:
Reply with quote

Try Subtraction!
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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