Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Interview question which I failed to answer.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
arindambanerjee

New User


Joined: 30 Jun 2007
Posts: 39
Location: India

PostPosted: Sat Jul 11, 2009 7:37 pm    Post subject: Interview question which I failed to answer.
Reply with quote

Hi,

I have been asked a question in an interview as below:

CASE1:
....
A0-section.
......
Perform AB-para.
...
...

A0-Exit
Exit.


AB-Para.
...
...
Perform D-para.
....
AB-para-end.
exit.

CASE2:

...
A0-section.
......
Perform AB-para thru AB-para-end.
...
...

A0-Exit
Exit.


AB-Para.
...
...
Perform D-para.
....
AB-para-end.
exit.


D-Para is there in the code as well.
the question was whats the difference between these two cases and if there is no difference then what will be the flow.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Sat Jul 11, 2009 8:54 pm    Post subject:
Reply with quote

Have you reviewed the COBOL Language Reference (manuals link at the top of the page) on the PERFORM statement?

PERFORM paragraph performs only that paragraph. So case 1 would execute the PERFORM, then A8-Para, then D-para, then at the end of A8-Para would return to A0-section and continue. If there's no program exit, control would fall through A0-Exit and start executing A8-Para and so forth.

The main difference in case 2 in that execution would go through the end paragraph, but otherwise there's no difference in execution sequence.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jul 13, 2009 3:01 pm    Post subject:
Reply with quote

There is no difference in both the approaches from execution per se as Robert has said; though at some shops coding "..thru AB-para-end" in "Perform AB-para thru AB-para-end" comes under coding standards. Every PARA should end with an EXIT though period (.) in place of EXIT would also do the same.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts ABEND due to FETCH FAILED jackzhang75 ABENDS & Debugging 17 Thu Mar 10, 2016 3:08 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us