Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Counter part of ( Do- while in C, C++) in COBOL.
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: 1187
Location: Bangalore,India

PostPosted: Tue May 16, 2006 1:29 pm    Post subject:
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    Post subject: Re: Counter part of ( Do- while in C, C++) in COBOL.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: Counter part of ( Do- while in C, C++) in COBOL.
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us