Use of nested If-Else..



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

Re: Use of nested If-Else..

Postby BillyBoyo » Fri Mar 16, 2012 11:27 pm

Now I'm confused. Are there two of you? Is bro the other one of you with whom you converse? Are you a Troll, or Trolls?

If you can find ELSE-IF or anything like it in the manual, feel free to use it. You can look at EVALUATE while you are reading the manual.

I think you've had all the answers you'll get from anyone else, just keep talking amongst yourself.

EDIT: Grammar smartened-up in deference to my learned colleague's able assistance.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Use of nested If-Else..

Postby Robert Sample » Fri Mar 16, 2012 11:54 pm

Dilip_M_G:
So no reply for my query bro?
is not warranted -- being told to go read the manuals IS an answer to your query. Whether or not you LIKE the answer, well, that's a different question. This is a HELP forum, not a READ-THE-MANUAL-FOR-YOU forum. If you are not willing to read the manual when told to do so, then don't ask questions here.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Use of nested If-Else..

Postby enrico-sorichetti » Fri Mar 16, 2012 11:55 pm

I'm coding some urgent requirement so had requested to reply soon

why not lurk into some colleague' s code !
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Use of nested If-Else..

Postby enrico-sorichetti » Fri Mar 16, 2012 11:56 pm

the problem as I see it, is to find out which of the two bro' s is the smart one :geek:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Use of nested If-Else..

Postby Monitor » Sat Mar 17, 2012 1:36 pm

Comment on Nested If.
- There is no Else-If, just Else If
You should alwas consider using Evaluate - End-Evaluate, when there is a need for more than 2 levels of Ifs.
"Easy to use - easy to modify"

Your "psudo-code" could look like this:
Evaluate True
   When (ABCD of file 1 = ABCD of file 2)
         write statement1
   When (ABCDE of file 1 < ABCDE of file 2)
         write statement2
   When Other
         write statement3
End-Evaluate
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: Use of nested If-Else..

Postby dick scherrer » Sun Mar 18, 2012 9:48 am

Hello,

So no reply for my query bro?
Have you looked n the COBOL Language Reference? Is there smething that is not yet clear? If you found somethng n the manjual that is confusing, post that content here and someone here will be able to clarify.

Hint - If you have something that is critical/urgent, a forum is not the best place to look for a coding solution. Your time would be better spent talking with your manager or another senior on your project and explain where you are stuck and if there is an existing module somewhere on the applicatoin that does something similar.
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

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post