Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts Copying part of the report using SARBCH Aedulla CA Products 1 Tue Oct 24, 2017 9:24 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us