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
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 10 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am


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