‎2010 Aug 19 6:40 PM
I have a situation where I need a report to come out - even if I have an Error or Abort Message.
I need the report so that i can email the users in a second step of a Job.
We want the CANELLED to show in the JOB queue but when that happens by doing a message with the error it does not output any spool file.
The code is simple:
CONCATENATE c_errors
c_error_645
INTO z_msg_line SEPARATED BY space.
WRITE z_msg_line TO z_output_line.
WRITE: z_output_line.
lv_errors = 'X'.
MESSAGE ID 'ZX' TYPE 'E' NUMBER '645'.
The job stops, shows CANCELLED but not output to the spool file.
If I change message type to I for imfomation I get the spoolfile but the JOB queue shows COMPLETED so a Basis person will not catch the Cancelled job.
Thanks.
‎2010 Aug 19 8:45 PM
Hi ,
raise a error message of type E , to see the reason just select the job and click the job log button in the tool bar.
‎2010 Aug 19 9:48 PM
Does the email processing have to occur within the same job? Why not establish a polling process for cancelled jobs where you control the job name(s) to poll for and the linked users to email? When you find a canceled job you can read the job log messages (assuming you have logged your errors using 'S' messages and then used a final 'E' message to stop the job) using function BP_JOBLOG_READ. You could establish a spool from that (and attach it) or just embed the messages in the email body itself.
I'm not sure what your scenario is though - I would separate application errors from technical errors in your error notification process, i.e., handle error notification/emailing within your programs themselves and avoid abending jobs if possible. Are these Basis-handled errors or user-handled errors that you're talking about?
Edited by: Brad Bohn on Aug 19, 2010 3:51 PM
‎2010 Aug 19 10:06 PM
In case of either an Abend Message(Type 'A') or a Short Dump Message (Type 'X'), the entire spool list is erased and thereafter unavailable.
In your case you are using Error message (Type 'E') and it should retain a spool. The same logic works perfectly fine in our system.
Just a wild guess, if there is any arrangement in your system to delete the spools for cancelled jobs.
‎2010 Aug 19 10:06 PM
We found away to make it work within the way it behaves. Thanks anyway.
‎2011 Aug 30 1:29 PM
I have the same situation. Would you please explain what you did to make it work?
Thanks.