January 24, 2007, 09:31 AM
DarrenHGOTO next process and stored procedure
Hi all,
I have a relatively simple task that I'm struggling a little with. I have 9 flows together in a process. Each time a flow completes (even if it fails) I want it to run a stored procedure and then move onto the next flow.
So far I have tried using:
-
EP_0
-TYPE (ICM18027) DEP_0: flow ftpbank started.
EX CMASAP REQ_NAME = ftpbank, CM_ASYNC = OFF, APPDIR = cmc, DEP_ALIAS = DEP_0, PRNT_REQ = &&CM__REQUEST
-RUN
-IF (&&KILL_RPC EQ 'Y') GOTO :STOPRPCS;
-TYPE (ICM18039) DEP_0 ftpbank Return Code = &&DEP_0_RC
-IF (&&DEP_0_RC EQ 0) GOTO
EP_1;
-IF (&&DEP_0_RC EQ 0) GOTO
EP_19;
-IF (&&DEP_0_RC NE 0) GOTO
EP_19;
-GOTO :ENDDEP
But this seems to go only to DEP_1 and not DEP_19. How to I get it to run both DEP_1 and DEP_19 if the condition is met?
Many thanks in advance!
January 24, 2007, 09:42 AM
FernandoDarren,
A goto can only go to one place. You need to adjust your logic. I am guessing that all of your flows may run the same procedure and therefore go to the same label. So here are two choices.
1) Use different labels:
-IF (&&DEP_0_RC EQ 0) GOTO EP_1_19;
Then EP_1_19 would do both the actions of EP_1 and EP_19. This would require a lot of labels.
2) Use a variable as a second jumping point and test that at the end of EP_1
-SET &NEXT_JUMP=IF (&&DEP_0_RC EQ 0) THEN 19;
-IF (&&DEP_0_RC EQ 0) GOTO EP_1;
-EP_1
Your rpc stuff goes here
-IF (&NEXT_JUMP EQ 19) GOTO EP_19;
Fernando
January 25, 2007, 09:05 AM
DarrenHOk. Thanks for that. I've changed the logic so that the sproc is called regardless, and I just update the status variable before I call the sporc and pass the parameters across.
Thanks guys!