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

How many times the Perform Loop executes


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

New User


Joined: 05 Dec 2006
Posts: 17
Location: Chennai

PostPosted: Wed Oct 24, 2007 12:42 pm
Reply with quote

Can anyone give me the right answer for the following:

PERFORM VARYING X FROM 1 BY 1 UNTIL X<3
MOVE X TO A
END-PERFORM.

How many times the above code will be executed?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 12:44 pm
Reply with quote

Sindu,

Quote:
How many times the above code will be executed?

What does the manual say?

If you still dint get the answer, IMPLEMENT and see how many times it gets executed.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Oct 24, 2007 1:10 pm
Reply with quote

The loop will not execute.
First time X=1 and X<3 the condition satisfied. It does not enter the loop at all. Correct me, If I am wrong.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Oct 24, 2007 1:57 pm
Reply with quote

Yes, Loop will not execute at all as in the first case itself condition is getting satisfied.

KSK
Back to top
View user's profile Send private message
sindhuvava
Currently Banned

New User


Joined: 05 Dec 2006
Posts: 17
Location: Chennai

PostPosted: Wed Oct 24, 2007 2:53 pm
Reply with quote

Yes u r right,i checked it out.

Thank You
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 3:04 pm
Reply with quote

Sindhu,

Quote:
i checked it out.

Good. You could have done before.
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
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts Updating a 1 byte thats in occurs mul... DFSORT/ICETOOL 6
No new posts REXX - Dataset checking in a do forev... CLIST & REXX 6
Search our Forums:

Back to Top