Focal Point
How to email one of the empty reports on multiple tasks scheduled job.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4691076992

September 17, 2008, 02:23 PM
Hua
How to email one of the empty reports on multiple tasks scheduled job.
I have setup a scheduled job to send 4 separate reports to the users on a daily bases. Some days we will have all four empty reports. I like stop the job after the first task generates an empty report and send this one empty report to the users.
Will &&KILL_RPC kill the entire scheduled job or just kill the procedure? I can not find reference to this system variable.

Thanks.


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
September 17, 2008, 05:57 PM
TexasStingray
What you need to do is create a pre execution procedure and the set &KILL_RPC. If the &KILL_RPC is Y then it will kill the rest of the execution. You can use a combination of dialog manager commands link &LINES to see if there is any data to report against or kill the job.




Scott

Hua

in case you want to send all four users a report that only says something like

"sorry, nothing to report today"

You should NOT use the &KILL_RPC. This stops the RC process and only sends a message to the application manager that this process is killed.

If you want that special report I would suggest this procedure.

TABLE FILE XXXX
PRINT AA 
BB
CC
BY USERCODE
WHERE etc
ON TABLE HOLD AS BASIC
END
-IF &RECORDS EQ 0 GOTO NOTHING
-* now create the normal report based upon the holded data.
TABLE FILE BASIC
PRINT AA 
BB
CC
BY USERCODE
END
-GOTO THE_END
-NOTHING
DEFINE FILE CAR
USERCODE/A10 WITH COUNTRY=DECODE COUNTRY(ITALY USER1 etc);
END
TABLE FILE CAR
BY USERCODE NOPRINT
HEADING
"sorry, nothing to report today" 
END
-THE_END



I think this would work.....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Hua?

did this work?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Frank

I am truely very appreciated for you help. Thank you for following up on my problem.
I think I understand what you suggested to do. I am using this tip in the focus point - ON TABLE SET EMPTYREPORT ANSI to generate an empty report automatically.
There might be a misunderstand here. I am sending 4 separate xls files (by 4 separate procedures) to a list of users daily. I know if one is empty, all 4 are empty. Having all 4 procedures scheduled on the same job will always sends 4 attachments (empty or not) to the users. So I wish to send only one to the users if they are empty.
I am slowly digesting the info on pre-processing proceudure, and looks like it is controlled at task level indpendingly. I am also concern what you said on Mark's post, that not able to tell the explicit kill from other causes of failure.
I haven't make any move yet. Users are recieving 4 reports regardless. Maybe they will get use to it. Or Mark's request could be my alternative - not sending any at all when they are empty.

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS