GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 3 of 162    Print  
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.


  
Total Answers and Comments: 5 Last Update: September 20, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: suma_infy
 
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



Above answer was rated as good by the following members:
ramanach, Nitin2cpg, glipkin3
January 18, 2006 04:14:49   #1  
poonguzhali        

RE: What is an in line PERFORM? When would you use it...

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


 
Is this answer useful? Yes | No
April 30, 2007 10:02:08   #2  
Suganj Member Since: February 2007   Contribution: 13    

RE: What is an in line PERFORM? When would you use it...
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.

 
Is this answer useful? Yes | No
August 26, 2007 23:21:07   #3  
Daryljax Member Since: August 2007   Contribution: 3    

RE: What is an in line PERFORM? When would you use it...
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.



 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
September 28, 2007 08:21:34   #4  
sudhakar chandu        

RE: What is an in line PERFORM? When would you use it...
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.
 
Is this answer useful? Yes | No
September 20, 2008 04:39:25   #5  
suma_infy Member Since: July 2008   Contribution: 3    

RE: What is an in line PERFORM? When would you use it? Anything else to say about it?
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


 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape