IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Counter part of ( Do- while in C, C++) in COBOL.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Tue May 16, 2006 1:20 pm
Reply with quote

Hi ,

Is there any counter part of ( Do- while in C, C++) in COBOL.

Regards,
Bh
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue May 16, 2006 1:29 pm
Reply with quote

U can use perform until.
i.e

do while i <=5
cobol equivllant

perform until i>5

Correction r welcome
Back to top
View user's profile Send private message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Wed May 17, 2006 1:04 pm
Reply with quote

The requirement is condition shouldn't change but control should enter the loop.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 01, 2006 5:59 pm
Reply with quote

Using TEST BEFORE before PERFORM is the equivalent for DO - WHILE loop
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jun 03, 2006 10:49 pm
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Mon Jun 05, 2006 10:56 am
Reply with quote

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
View user's profile Send private message
bh

New User


Joined: 19 Mar 2006
Posts: 26
Location: India

PostPosted: Thu Jun 15, 2006 10:44 am
Reply with quote

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top