Evaluate Statement



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Evaluate Statement

Postby sriharsha186 » Fri Jul 26, 2013 4:44 pm

If evaluate statement is to be replaced which one of these suits better?

NESTED IF, IF THEN ELSE, IF ELSE
sriharsha186
 
Posts: 2
Joined: Tue Jul 23, 2013 10:00 am
Has thanked: 0 time
Been thanked: 0 time

Re: Evaluate Statement

Postby NicC » Fri Jul 26, 2013 4:49 pm

Depends.

Why do you want to replace it, anyway?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Evaluate Statement

Postby sriharsha186 » Fri Jul 26, 2013 4:52 pm

Well, it was a question I was asked. "Evaluate is similar to"
sriharsha186
 
Posts: 2
Joined: Tue Jul 23, 2013 10:00 am
Has thanked: 0 time
Been thanked: 0 time

Re: Evaluate Statement

Postby NicC » Fri Jul 26, 2013 4:56 pm

Why don't you look up the book/notes you used when learning COBOL? Or is this an interview question that should have been posted in the Interview Questions section along with your response.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Evaluate Statement

Postby dick scherrer » Fri Jul 26, 2013 9:31 pm

Hello and welcome to the forum,

Hopefully, when the question was asked, more info was given.

As asked, the only answer i would give would be the same as Nic's - it depends.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Evaluate Statement

Postby c62ap90 » Fri Jul 26, 2013 11:50 pm

All 3 as it was before COBOL II.
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: Evaluate Statement

Postby NicC » Fri Jul 26, 2013 11:53 pm

Actually, there are only 2 options there as IF ELSE is a synonym of IF THEN ELSE.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Evaluate Statement

Postby BillyBoyo » Sat Jul 27, 2013 4:07 am

If you were looking at directly replacing existing code with an EVALUATE, the most likely candidates would be a "nested IF", a series of IFs with GO TOs or a plain old GO TO ... DEPENDING ON ...

However, you could replace any IF with an EVALUATE in its simplest form, or number of IFs of any variety if you would accept a non-1:1 relationship between what was replaced and the "legs" of the EVALUATE.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post