GeekInterview.com
Series: Subject: Topic:
Question: 188 of 232

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.
Asked by: Interview Candidate | Asked on: Sep 29th, 2004
Showing Answers 1 - 5 of 5 Answers
poonguzhali

Answered On : Jan 18th, 2006

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

  
Login to rate this answer.

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.

  
Login to rate this answer.
Daryljax

Answered On : Aug 26th, 2007

View all answers by Daryljax

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. 

Yes  2 Users have rated as useful.
  
Login to rate this answer.
sudhakar chandu

Answered On : 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.

  
Login to rate this answer.

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-NAMEPERFORM UNTIL WS-NAME=‘JOHN’ACCEPT WS-NAMEDISPLAY “THE NAME OF EMPLOYEE : ‘ WS-NAMEEND-PERFORM

Yes  4 Users have rated as useful.
  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.