| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
pkmurali
Joined: 15 Dec 2005
Posts: 58
|
| Posted: Thu Jul 03, 2008 1:13 pm Post subject: Doubt in Perform ..Thru... |
|
|
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
Joined: 05 Mar 2008
Posts: 68
Location: chennai
|
| Posted: Thu Jul 03, 2008 1:22 pm Post subject: |
|
|
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
Joined: 19 Jul 2007
Posts: 5
Location: mumbai
|
| Posted: Thu Jul 03, 2008 3:28 pm Post subject: Reply to: Doubt in Perform ..Thru... |
|
|
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
Joined: 13 Feb 2004
Posts: 360
Location: Bangalore
|
| Posted: Thu Jul 03, 2008 3:35 pm Post subject: |
|
|
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
Joined: 30 May 2003
Posts: 1506
|
| Posted: Thu Jul 03, 2008 6:43 pm Post subject: |
|
|
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
Joined: 20 Oct 2006
Posts: 1639
Location: germany
|
| Posted: Thu Jul 03, 2008 7:17 pm Post subject: |
|
|
| 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 |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|