View previous topic :: View next topic
|
Author |
Message |
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Hi ,
Is there any counter part of ( Do- while in C, C++) in COBOL.
Regards,
Bh |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
U can use perform until.
i.e
do while i <=5
cobol equivllant
perform until i>5
Correction r welcome |
|
Back to top |
|
|
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
The requirement is condition shouldn't change but control should enter the loop. |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Using TEST BEFORE before PERFORM is the equivalent for DO - WHILE loop |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Prasad,
I think it's TEST AFTER, i.e.
Code: |
PERFORM PGRAPH-A WITH TEST AFTER VARYING SUB
FROM +1 BY +1
UNTIL SUB = +5 |
|
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Thanks for correcting me Jack,
Indeed it is so. I was little confused.The default is test before and we should go for test after. |
|
Back to top |
|
|
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Thanks |
|
Back to top |
|
|
|