JamesR
70 pts. | Oct 27 2009 5:58PM GMT
Here are snipets of the code:
ENDPROC:
RETURN
/* ==================================
SUBR SUBR(FTP)
ENDSUBR
/* ========================================
SUBR SUBR(SWAPLIBL)
When it hits SWAPLIBL is fails And I end with:
ENDSUBR
/* =========================================
ENDPGM: ENDPGM
Thanks!
Teandy
3250 pts. | Oct 27 2009 8:15PM GMT
I am doing pretty much the same thing you are. Here is my code.
/*********************************************************************/
/* STOP THE SUBROUTINES FROM BEING EXECUTED AT PROGRAM END. */
/*********************************************************************/
GOTO CMDLBL(ENDCLPGM2)
/*********************************************************************/
/* SUBROUTINE TO SUBTRACT A NUMBER OF DAYS FROM THE DATE. */
/*********************************************************************/
SUBR SUBR(GETDATE)
CALLPRC PRC(SUBDAYSR) PARM((&DATE#) (&DAYSTOSUB)) +
RTNVAL(&DATE#)
ENDSUBR
/*********************************************************************/
/* SUBROUTINE TO CONVERT DATE TO B&L FILE FORMAT. */
/*********************************************************************/
SUBR SUBR(CONVRTDATE)
CALLPRC PRC(RTVBLFILDT) PARM((&DATE#)) +
RTNVAL(&CHKDATE#)
ENDSUBR
ENDCLPGM2:
ENDPGM
The only thing I can see different between yours and mine is the Return statement. What happens if you take it out?
JamesR
70 pts. | Oct 27 2009 8:28PM GMT
When I take out the RETURN statement I get the same error.
Tom… look at my last post… you will see I have a TAG and a RETURN.
TomLiotta
7990 pts. | Oct 27 2009 8:37PM GMT
JamesR:
In the code that I can see, there are no statements shown between the two SUBR and ENDSUBR sections — the subroutine statements are snipped out. What statements immediately precede the two ENDSUBRs?
Tom
JamesR
70 pts. | Oct 28 2009 11:43AM GMT
As I posted earlier:
ENDPROC:
RETURN
/* ==================================
SUBR SUBR(FTP)
…
ENDSUBR
/* ========================================
SUBR SUBR(SWAPLIBL)
…
ENDSUBR
/* =========================================
ENDPGM: ENDPGM
JamesR
70 pts. | Oct 28 2009 11:50AM GMT
I FOUND IT! It was caused by an unmatch DO statement in the SUBR before the SUBR it failed on…. this is what I had in SUBR FTP:
RTVMBRD FILE(RVUXCEL) NBRCURRCD(&RCDCNT) MONMSG MSGID(CPF0000) EXEC(DO) IF COND(&RCDCNT *EQ 0) THEN(DO) CHGVAR VAR(&MSG60) VALUE(’The uploaded file is empty’) CHGVAR VAR(&ERRCODE) VALUE(’1002′) RTNSUBR ENDDO
There was an error message about it but it was buried in all the other error message it caused. Thanks for your help all!
TomLiotta
7990 pts. | Oct 28 2009 9:08PM GMT
I’m glad you found it because you still didn’t show what was immediately before the two ENDSUBRs. Without knowing the code that comes before the ENDSUBRs, it’s difficult to see something like a missing ENDDO.
Another possiblity is that MONMSG might have been before the ENDSUBR. IBM released a PTF for that one.
/* ==================================
SUBR SUBR(FTP)
<– here is immediately before ENDSUBR
ENDSUBR
Usually, just the single command before the ENDSUBR is enough to know the solution. BTW, was there no “mismatched DO-ENDDO” error message? What severity was on the message if one was sent?
Tom






