MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PERFORM statements in COBOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Torie03
Beginner


Joined: 02 Dec 2003
Posts: 1
Topics: 1

PostPosted: Tue Dec 02, 2003 3:40 pm    Post subject: PERFORM statements in COBOL Reply with quote

Hi everyone,

I'm a college student and i was wondering if anyone could help me out? What is better a Procedural PERFORM or an IN-LINE PERFORM statement?And what PEFRORM statement is the best one: the Perform....times, the perform...until, or the perform....varying? ANd why? I'm just confused b/c my text book doesnt explain it at all!! And I can't find any relevant websites! Thank for any and all help! It's must appreciated! Confused
Back to top
View user's profile Send private message
RobertL
Beginner


Joined: 18 Nov 2003
Posts: 22
Topics: 0
Location: Lisbon, Portugal

PostPosted: Tue Dec 02, 2003 6:12 pm    Post subject: Reply with quote

Hello Torie,
There isn't a better or worse PERFORM statement. They are each used for different types of situations.

In-line PERFORMs are for when you need to execute one or two (or zero) lines of code multiple times when it doesn't make sense to create a new paragraph (it also makes the code more readable in these cases).
PERFORM...TIMES is for when a paragraph or block of code needs to be executed a fixed number of times.
PERFORM...UNTIL is for when a paragraph or block of code needs to be executed until a particular condition is met.
the VARYING clause is used with PERFORM to increment (or decrement) an index each time the loop is executed.

Hope this helps.
Regards,
Robert
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Dec 03, 2003 6:52 am    Post subject: Reply with quote

Torie03,

welcome to mvsforums.As robert stated, each of the perform statement can be used based on the situation.As you are a student, I would advise you not to spend more time trying to determine which is more efficient as these instructions might save you a nano second in the long run.

With the latest and greatest cobol you don't have to worry about the efficiency of various cobol verbs.

check this topic which discusses COBOL Performance Tuning

http://www.mvsforums.com/helpboards/viewtopic.php?t=1485

Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group