View previous topic :: View next topic |
Author |
Message |
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon Dec 30, 2002 9:00 am Post subject: Inline Perform in cobol |
|
|
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 |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon Dec 30, 2002 9:59 am Post subject: |
|
|
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 |
|
|
zatlas Beginner
Joined: 17 Dec 2002 Posts: 43 Topics: 4
|
Posted: Mon Dec 30, 2002 10:18 am Post subject: |
|
|
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 .
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 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Dec 30, 2002 10:22 am Post subject: |
|
|
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 |
|
|
RonB Beginner
Joined: 02 Dec 2002 Posts: 93 Topics: 0 Location: Orlando, FL
|
Posted: Mon Dec 30, 2002 10:42 am Post subject: |
|
|
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 |
|
|
|
|