View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Dear all,
while Executing the below piece of codes,
In code-1 after performing Para-a control goes to Para-c.
In code-2 after performing Para-a control foes to Para-b.
Will 'Thru' tracks down the control while exiting a para?
Please Let me know how the tracking process happens?
Regards,
Murali.
Code-1
-----------------------
Perform para-a .
Perform para-b
.
.
.
Para-a.
.
.
Go to Para-a-exit.
Para-a-exit.
Exit.
Para-c.
------------------------------------
Code-2
----------------------------------------------
Perform para-a Thru para-a-exit.
Perform para-b
.
.
.
Para-a.
.
.
Go to Para-a-exit.
Para-a-exit.
Exit.
Para-c.
------------------------------------------------- |
|
Back to top |
|
|
birdy K
New User
Joined: 05 Mar 2008 Posts: 72 Location: chennai
|
|
|
|
In code-1.
In Para-a. Go to para-a-exit. The control is not coming back. So the next statement of para-c is working.
In code-2.
Perform para-a thru para-a-exit. The control is coming back. And then control Perform para-b is working.
Corrections are welcome. |
|
Back to top |
|
|
santy Warnings : 1 New User
Joined: 19 Jul 2007 Posts: 22 Location: mumbai
|
|
|
|
For code-1:-
In Para-a. Go to para-a-exit. Go To command is not giving back to Para-a. So the next statement of para-c is working.
For code-2:-
Perform para-a thru para-a-exit. The control is coming back at para-a. And then control Perform para-b is working. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
In code 1
you are not mentioning the end of the active perform ....
please refer to cobol language reference manual and check for EXIT statement definition |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
The thru .... sets the exit pgraph to return to the NSI after the perform.
If you don't use thru when you GOTO a-exit the EXIT is a NOOP so you fall thru to pgraph C. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
another reason to use sections. within the section only have one paragraph, the exit. then you can use your primative go to coding. |
|
Back to top |
|
|
|