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 Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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