View Full Version : SBMJOB MONMSG
01-01-1995, 02:00 AM
What CPF Messages to be used for catching the Error occurred during SBMJOB. For example in a SBMJOB I can call a program. The error possibilities are program object is not found, object library is not found or some other error. In the previous step I am not doing CHKOBJ. But I have to trap only from SBMJOB command. So any one who knows this kind of problem can give me a solution to trap the Errors occured in the SBMJOB command.
04-19-2000, 03:13 AM
You could use a MONMSG command with the wildcard (I think it's CPF0000 or CPF9999) directly after the call/submit line in the CL program, but you'll need to tell it what to do if the message appears. EG ADDLIBLE LIB(PHCANCEL) POSITION(*FIRST) MONMSG MSGID(CPF2103)EXEC(GOTO CMDLBL(CLR)) CLR: CALL PGM(PGM01) This makes an addition to the library list, and the MONMSG is checking to see if a message comes back saying the library is already in the list. If it is already in the list then the program won't dump because it's ready for it. I can't remember the wildcards I'm afraid, but if there are only one or two messages you need to monitor for then try coding them in specifically. HTH Katy
04-19-2000, 05:37 AM
The wildcard to trap is CPF0000.
04-19-2000, 06:02 AM
04-19-2000, 06:11 AM
The online help for AS400 commands lists all possible error messages that could be returned when the command is executed. The CALL command for example: Prompt CALL. Press Help. Press F2=Extended Help. Then the following information is available: Error messages for CALL *ESCAPE Messages CPD0783 Variable &3 for parameter &2 Must be TYPE(*DEC), LEN(&4, &5) CPF0005 Returned command string exceeds variable provided length. CPF0006 Errors occurred in command. CPF0805 Error found when program &1 in &2 started. CPF0806 Error found when procedure started.
04-19-2000, 08:13 AM
Kannan The submit job will return any type of error depending on what job you actually submitted. If any error you get you will always get any of the three messages listed below. The most possible one is CPF1338. Error messages for SBMJOB *ESCAPE Messages CPF133A SBMJOB not allowed during IPL. CPF1338 Errors occurred on SBMJOB command. CPF1651 Sort sequence table not accessed. Hope this solves your problem. Elan
04-19-2000, 09:07 AM
Kannan, errors resulting from failures in the submitted command itself can't be monitored by the program doing the SBMJOB. If you code this: SBMJOB CMD(call badlib/badpgm) MONMSG CPF0000 EXEC(do something) and badlib or badpgm don't exist, there will be no exception, so the MONMSG will not do the "do something". Instead, the submitted job will just end abnormally. Barbara Morris
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.