What is an in line PERFORM? When would you use it? Anything else to say about it?

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.

Showing Answers 1 - 11 of 11 Answers

poonguzhali

  • Jan 18th, 2006
 

Perform stmt doesn't contain any paragraph name, it will perform all the instructions with in that.

  Was this answer useful?  Yes

Hi,
   When the body of the perform is not used in any other para. when the body of the perform is used in any other para then it's better to use the code in separate para and use PERFORM paraname instead of using in-line perform.

Hope u got it.

  Was this answer useful?  Yes

Daryljax

  • Aug 26th, 2007
 

Examples: inline:

PERFORM UNTIL X > 10
    ...
END-PERFORM.


PERFORM WHILE X < 11
    ...
END-PERFORM.

Examples: Non-inline:

PERFORM 1000-READ-FILEA THRU 1000-READ-EXIT UNTIL x > 10.

PERFORM 1000-READ-FILEA THRU 1000-READ-EXIT WHILE X < 11.


 

sudhakar chandu

  • Sep 28th, 2007
 

In-line perform is a concept where the control will execute a block of statements residing in a same paragraph and here the control will not shift form one paragraph to another paragraph.

  Was this answer useful?  Yes

In In-line PERFORM the procedure name is omitted. An In-line PERFORM must be delimited by the END-PERFORM statement.

SYNTAX:

          PERFORM

                   Imperative Statements

          END-PERFORM.
eg:

ACCEPT WS-NAME

PERFORM UNTIL WS-NAME=‘JOHN’

ACCEPT WS-NAME

DISPLAY “THE NAME OF EMPLOYEE : ‘ WS-NAME

END-PERFORM

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions