confuse about DO WHILE structure



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

confuse about DO WHILE structure

Postby lxw039 » Tue Oct 21, 2008 6:50 pm

how are you, guys, I have a question ask for yours help.
PERFORM 100-PROCESS-DATA UNTITL EOF='Y'.
eah cobol book says: this is a DO WHILE structure, but I think DO WHILE describ as following:
" loop body excute if condition is true, otherwise exit loop if condition is false."
but anybody knows that the above statement is loop body excute if condition(EOF='Y') is false,
when the condition is true, it will exit loop.
as a result, the statement is not a DO WHILE structure,
anybody can tell me the answer? thanks first.
lxw039
 
Posts: 47
Joined: Tue Oct 07, 2008 11:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: confuse about DO WHILE structure

 

Re: confuse about DO WHILE structure

Postby dick scherrer » Wed Oct 22, 2008 2:07 am

Hello,

Yes, it can be thought of as a DO WHILE.

The WHILE is "EOF not= 'Y'".
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: confuse about DO WHILE structure

Postby lxw039 » Wed Oct 22, 2008 6:25 pm

I got it, thank you very much, Mr. Dick.!
lxw039
 
Posts: 47
Joined: Tue Oct 07, 2008 11:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: confuse about DO WHILE structure

Postby dick scherrer » Thu Oct 23, 2008 2:31 am

You're welcome :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post