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 

Inline Perform 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
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Mon Dec 30, 2002 9:00 am    Post subject: Inline Perform in cobol Reply with quote

Hi

What is meant by inline perform statement in Cobol.. What are the different types of perform statements.. Please clarify me..

anand
Back to top
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Mon Dec 30, 2002 9:59 am    Post subject: Reply with quote

Hi,

I found the info from quick view..

In an out-of-line PERFORM statement, a procedure name (or names) is
specified and control is transferred "out-of-line" to the specified
procedures. In an in-line PERFORM, a set of "in-line" statements
(followed by an END-PERFORM delimiter) make up the procedure to be
performed.


Anand
Back to top
View user's profile Send private message
zatlas
Beginner


Joined: 17 Dec 2002
Posts: 43
Topics: 4

PostPosted: Mon Dec 30, 2002 10:18 am    Post subject: Reply with quote

Hi
The best way to relate to in line PERFORM is to view it as the COBOL implementation of other languages' 'do', 'do while', 'while' and 'for' statements.
The out of line PERFORM is something that MOST other major languages actually lack, it is the ability to dedicate part of your current program (with the same scope and view as the rest of the program) as if it was a quasi-CALLed or otherwise invoked method. The fanatics of the 'other side of the tracks' languages despise this feature, claiming that if you invoke a method it must be a rather closed box without a full view of the rest of the program. They might be politically (and theoretically) correct but we all know how handy is the out of line PERFORM Very Happy .
ZA
P.S. I remember when I first learned C this was the only feature of COBOL I really missed, so I coded a preprocessor ready header file to introduce the feature. This was how I learned the hard way how primitive and backwards is the C preprocessor, when you compare it to something serious like, for example, the mainframe's Assembler conditional assembly features Wink
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Dec 30, 2002 10:22 am    Post subject: Reply with quote

Anand_r,

An IN-LINE PERFORM Statement allows the routine being performed to be nested within the perform statement itself instead of being a seperate paragraph.

Check this Example: inline PERFORM statement


The different kinds of performs are :


  • PERFORM
  • PERFORM THRU
  • PERFORM 'n' of TIMES
  • PERFORM UNTIL
  • PERFORM VARYING with UNTIL Option.


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Mon Dec 30, 2002 10:42 am    Post subject: Reply with quote

Please do not neglect to take into consideration the WITH TEST BEFORE and WITH TEST AFTER options of the PERFORM . . .UNTIL. WHEN the test is made to determine whether to end the PERFORM can make a BIG difference in results.

Ron
Back to top
View user's profile Send private message
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