Page 1 of 2

Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:34 pm
by Dilip_M_G
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!!!!

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:37 pm
by BillyBoyo
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!!!

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:40 pm
by Dilip_M_G
i presume the use of if-else like the way you have typed is not a valid in cobol.It is not the keyword.

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:41 pm
by enrico-sorichetti
Please do reply at earliest.

what makes You think that we are willing to quit what we are doing to reply to You ? :evil:

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:43 pm
by enrico-sorichetti
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!

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:44 pm
by Robert Sample
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!

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:50 pm
by Dilip_M_G
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

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 10:58 pm
by BillyBoyo
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.

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 11:02 pm
by Dilip_M_G
So no reply for my query bro?

Re: Use of nested If-Else..

PostPosted: Fri Mar 16, 2012 11:24 pm
by Akatsukami
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.