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
 

 

How many times the Perform Loop executes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How many times the Perform Loop executes
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: 1439
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 12:44 pm    Post subject:
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    Post subject:
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: 356
Location: New York

PostPosted: Wed Oct 24, 2007 1:57 pm    Post subject:
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    Post subject: Reply to: How many times the Perform Loop executes
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: 1439
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 3:04 pm    Post subject:
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    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 How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am
No new posts How to perform Digest Access Authenti... vasanthz All Other Mainframe Topics 0 Tue Mar 15, 2016 4:47 pm
No new posts OMEGAMON to see In-DB2 times and Wait... Archana89 IBM Tools 4 Fri Mar 04, 2016 11:28 am
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm


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