Use of nested If-Else..



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

Use of nested If-Else..

Postby Dilip_M_G » Fri Mar 16, 2012 10:34 pm

Hi ,

I'm struck with the situation where I'm finding the difficult to get answer anywhere.In the program the condition is as follows

if (ABCD of file 1 = ABCD of file 2)
write statement1
else-if (ABCDE of file 1 < ABCDE of file 2)
write statement2
else
write statement3.

The problem is how do i use 'ELSE-IF'? Please do reply at earliest.

Thanks in advance!!!!
Dilip_M_G
 
Posts: 12
Joined: Wed Nov 02, 2011 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: Use of nested If-Else..

 

Re: Use of nested If-Else..

Postby BillyBoyo » Fri Mar 16, 2012 10:37 pm

Dilip_M_G wrote:Hi ,

I'm struck with the situation where I'm finding the difficult to get answer anywhere.In the program the condition is as follows

if (ABCD of file 1 = ABCD of file 2)
   write statement1
else-if (ABCDE of file 1 < ABCDE of file 2)
  write statement2
else
 write statement3.


The problem is how do i use 'ELSE-IF'? Please do reply at earliest.

Thanks in advance!!!!


Is this early enough? Look in the manuals. The explanations of IF are clear enough. If you still have a problem, come back and explain what you don't understand.

Please do acknowledge receipt at earliest. Thanks in advance!!!
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Use of nested If-Else..

Postby Dilip_M_G » Fri Mar 16, 2012 10:40 pm

i presume the use of if-else like the way you have typed is not a valid in cobol.It is not the keyword.
Dilip_M_G
 
Posts: 12
Joined: Wed Nov 02, 2011 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: Use of nested If-Else..

Postby enrico-sorichetti » Fri Mar 16, 2012 10:41 pm

Please do reply at earliest.

what makes You think that we are willing to quit what we are doing to reply to You ? :evil:
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: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Use of nested If-Else..

Postby enrico-sorichetti » Fri Mar 16, 2012 10:43 pm

presume the use of if-else like the way you have typed is not a valid in cobol.It is not the keyword ...

better see an ophthalmologist
the pseudo code snippet was a quote of what You posted!
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: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Use of nested If-Else..

Postby Robert Sample » Fri Mar 16, 2012 10:44 pm

The problem is how do i use 'ELSE-IF'?
What have you tried? Is it working or not working and if not, what are the details? Have you read the Enterprise COBOL Language Reference manual on the IF statement? If not, WHY NOT? The manual is the authoritative source!

Please do reply at earliest.
Why? Unless you are paying me for my expertise, such a demand is not only futile but also extremely arrogant. The people who respond on this forum are volunteers, and respond if / when they can -- NOT at your beck and call. If you need a response so quickly, go hire a consultant to provide you with the answer -- don't ask on a forum!
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Use of nested If-Else..

Postby Dilip_M_G » Fri Mar 16, 2012 10:50 pm

Robert n Enrico I'm extremely sorry for using please do reply at earliest. I'm coding some urgent requirement so had requested to reply soon
Dilip_M_G
 
Posts: 12
Joined: Wed Nov 02, 2011 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: Use of nested If-Else..

Postby BillyBoyo » Fri Mar 16, 2012 10:58 pm

Dilip_M_G wrote:i presume the use of if-else like the way you have typed is not a valid in cobol.It is not the keyword.


:-)

I think, as enrico has noticed, the pressure of work has got you sorting your own problems out. Oh... that's a good thing. Now to achieve it without having to first post your thoughts on a forum, and without having to misattribute the original curious code.

Soon as you can, please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Use of nested If-Else..

Postby Dilip_M_G » Fri Mar 16, 2012 11:02 pm

So no reply for my query bro?
Dilip_M_G
 
Posts: 12
Joined: Wed Nov 02, 2011 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: Use of nested If-Else..

Postby Akatsukami » Fri Mar 16, 2012 11:24 pm

Dilip_M_G wrote:So no reply for my query bro?

Address him as "Mr. Boyo", mushi. And me as "Akatsukami-sama".

He did indeed give you a reply. It was:
Look in the manuals. The explanations of IF are clear enough. If you still have a problem, come back and explain what you don't understand.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post