View previous topic :: View next topic
|
Author |
Message |
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi all,
Below is the procedure division in our program.
Code: |
PROCEDURE DIVISION USING PARM-AREA.
-----------------------------------------------------
PERFORM 0100-GET-DATES THRU 0100-EXIT.
PERFORM 0200-OPEN-FILES THRU 0200-EXIT.
PERFORM 0300-PROCESS-CUSIP THRU 0300-EXIT
UNTIL NO-MORE-CUSIP.
PERFORM 8000-CLOSE-FILES THRU 8000-EXIT.
STOP RUN. |
0100-GET-DATES thru 8000-CLOSE-FILES para's are defined below. At the end ie., after 8000-CLOSE-FILES there is a pra names 1200-GET-CUSIP- para. AFter which para this 1200-GET-CUSIP will get executed??? Please advise. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Why do you think it will get executed ? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
k.a.khamaurutheen,
are you serious? you show us A and then ask if B is invoked.
look at your compile output xref, the paragraph/section will either have a referencing statement or it will not.
more than likely, one of the PERFORMed para/sections that you showed us will invoke the others.
I have included an ISPF EDIT MACRO (that can be used in edit and view) which might help you:
Code: |
/* REXX */
/* member name = whocalls */
/* FINDS ALL 'PERFORMS' FOR THE CURSOR SELECTED SECTION. */
/* */
/* */
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
ADDRESS ISREDIT
"MACRO"
/* TRACE ?R */
"(WRKDATA) = LINE .ZCSR"
WRKDATA_LEN = LENGTH(WRKDATA)
/* */
/* FIND WORD SECTION. AND THEN WORK BACKWARDS */
/* FOR THE SECTION NAME */
/* */
SPACE_POS = INDEX(WRKDATA,' SECTION. ')
IF SPACE_POS = 0 THEN EXIT
WRKDATA = LEFT(WRKDATA,SPACE_POS)
WRKDATA = STRIP(WRKDATA,'B')
WRKDATA_LEN = LENGTH(WRKDATA)
SPACE_POS = LASTPOS(' ',WRKDATA)
IF SPACE_POS > 0 THEN
DO
WRKDATA = RIGHT(WRKDATA,WRKDATA_LEN - SPACE_POS)
END
"FIND ALL " WRKDATA
"X ALL '*' 1"
"X ALL '*' 7"
"FIND FIRST NX" WRKDATA
EXIT
|
I always code using SECTIONs and NOT PARAGRAPHs. So if the module is paragraphed, you will have to modify the macro. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi,
Thanks for your quick response. This code came to my box for analysis. i was just analysing the code and i was just confused how this para is invoked without any call statement!!! This was in production . i will try to pull it in test and do some test hits and let you know the result. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
khamarutheen,
Do you mean you code is like-
Code: |
8000-CLOSE-FILES.
--- stmts
---
1200-GET-CUSIP- para.
--- stmts
---
---
8000-EXIT. |
?
If this is the case and you do PERFORM 8000-CLOSE-FILES THRU 8000-EXIT. then after 8000-CLOSE-FILES para it shoule fall through in to 1200 para. Do you have anything different in your mind? |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Quote: |
If this is the case and you do PERFORM 8000-CLOSE-FILES THRU 8000-EXIT. then after 8000-CLOSE-FILES para it shoule fall through in to 1200 para. Do you have anything different in your mind? |
Yep it falls like that only... But see the below code. After 8000-Exit. It will stop the execution. I guess it wont go to any other para in the pgm.
Code: |
PERFORM 8000-CLOSE-FILES THRU 8000-EXIT.
STOP RUN. |
|
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Yes.
PERFROM -- thru -- can execute multiple paragraphs /sections.
It is the expected behaviour. I don't see any problem here, do you? |
|
Back to top |
|
|
|