rtuohy
Member
Re: Calling JDE from external menus
John,
To see what the CL is actually doing, and to understand what I am getting
at, please try the following very small CL and run it under source debug
with break points on the GOTO ENDPGM and the RTVJOBA. You will notice that
the individual MONMSG overrides the global (ISDB does not stop at labels).
This is what I am talking about when I suggest a catchall. Obviously you
have to ensure that you catch all the errors you need to trap at command
level, but the point is that if you do not have to trap the errors that do
not matter, the global MONMSG allows the program to continue quite happily
doing what has to be done without a considerable amount of unnecessary code
which can make the program difficult to read and without falling over
because the programmer has neglected to trap every eventuality.
PGM
DCL VAR(&JOB) TYPE(*CHAR) LEN(10)
MONMSG MSGID(CPF0000 CPC0000 CPD0000) EXEC(GOTO +
CMDLBL(ABEND))
CALL PGM(JTEST) /* NON EXISTENT PROGRAM */
MONMSG MSGID(CPF0000 CPC0000 CPD0000) EXEC(GOTO +
CMDLBL(EXIT))
ABEND:
GOTO CMDLBL(ENDPGM)
EXIT:
RTVJOBA JOB(&JOB)
ENDPGM: ENDPGM
>
I do understand what you are getting at, and obviously this technique should
not be used without an understanding of how it works, but feel you are
negating a perfectly valid use of MONMSG. In fact, if you look at most of
the JDE programs which use the global to point to ABEND, you will notice the
SNDPGMMSG has a separate MONMSG attached to stop it being picked up by the
global MONMSG and looping round the ABEND. Thus you can trap and act on
individual errors while still using the global to handle what is not
important.
Regards
Ron
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
John,
To see what the CL is actually doing, and to understand what I am getting
at, please try the following very small CL and run it under source debug
with break points on the GOTO ENDPGM and the RTVJOBA. You will notice that
the individual MONMSG overrides the global (ISDB does not stop at labels).
This is what I am talking about when I suggest a catchall. Obviously you
have to ensure that you catch all the errors you need to trap at command
level, but the point is that if you do not have to trap the errors that do
not matter, the global MONMSG allows the program to continue quite happily
doing what has to be done without a considerable amount of unnecessary code
which can make the program difficult to read and without falling over
because the programmer has neglected to trap every eventuality.
PGM
DCL VAR(&JOB) TYPE(*CHAR) LEN(10)
MONMSG MSGID(CPF0000 CPC0000 CPD0000) EXEC(GOTO +
CMDLBL(ABEND))
CALL PGM(JTEST) /* NON EXISTENT PROGRAM */
MONMSG MSGID(CPF0000 CPC0000 CPD0000) EXEC(GOTO +
CMDLBL(EXIT))
ABEND:
GOTO CMDLBL(ENDPGM)
EXIT:
RTVJOBA JOB(&JOB)
ENDPGM: ENDPGM
>
I do understand what you are getting at, and obviously this technique should
not be used without an understanding of how it works, but feel you are
negating a perfectly valid use of MONMSG. In fact, if you look at most of
the JDE programs which use the global to point to ABEND, you will notice the
SNDPGMMSG has a separate MONMSG attached to stop it being picked up by the
global MONMSG and looping round the ABEND. Thus you can trap and act on
individual errors while still using the global to handle what is not
important.
Regards
Ron
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.