Page 1 of 1
need explanation on flow of perform stmt?
Posted: Thu Dec 16, 2010 2:20 am
can some one explain the flow of this one?
Code: Select all
DISPLAY "In TopLevel. Starting to run program"
DISPLAY "Back in TopLevel.".
DISPLAY " Now in TwoLevelsDown."
DISPLAY " Back in TwoLevelsDown.".
DISPLAY " Now in OneLevelDown"
DISPLAY " Back in OneLevelDown".
DISPLAY " Now in ThreeLevelsDown".
[ CODE ] [ / code ] tags added by dbz
for explanation of BBCode
Posted: Thu Dec 16, 2010 2:07 pm
nikilkarna wrote:can some one explain the flow of this one?
what is the output when you run the program?
each paragraph has a
- DISPLAY enter paragraph
- PERFORM someother-para
- DISPLAY exit (back in) paragraph
rather straight forward.
Posted: Thu Dec 16, 2010 3:46 pm
TopLevel para executes Oneleveldown para.. in which it will call .. twoleveldown para.. in whcih it will call Threeleveldown para...
Might be .. this is an example.. to explain.. how PERFORM will work in COBOL.
and how control pass thru this program.
When you run.. based on output you can understand how control passed between threse paras.
PERFORM - It will execute the sepcified para and control return back to next statement after PERFORM.
Posted: Thu Dec 16, 2010 7:19 pm
i need output of this program and the control flow. As vamsi said that it will execute the specific para(OneLevelDown) and will the control comes back to statement(display in the para and stop run will encounter) or will it pass to the next statement(next perform).
Posted: Thu Dec 16, 2010 7:28 pm
you need to RTFM and learn basics for COBOL. Learn about the Perform Statement.
compile and execute the program and gather your own output.
Posted: Tue Dec 28, 2010 12:42 pm
I agree with Dick and suggest to compile/execute the program to know (understand) the flow of the Program.
And why don't you do it (compile/execute) as the first thing, by the way!
Posted: Sun Jan 02, 2011 8:56 pm
following cobol material from mainframegurukul , may be useful to you to learn cobol.
http://www.mainframegurukul.com/tutoria ... orial.html