Focal Point
Can 0 records found = No Distribution & append notification to another fex?
March 14, 2008, 01:17 PM
Chris AustinCan 0 records found = No Distribution & append notification to another fex?
Report A is run daily by A.fex. Reports B & C are related to A (A=transactionsDaily; B=holdingsByDealer; C=holdingsByName), and are created by running B.fex and C.fex respectively. Report A is generated and distributed by Report Caster...when it does not find any records to report for that day, it is distributed empty.
My requirements for this enhancement are...
When Report A contains no records:
Cancel distribution of the report
Append a string to the bottom of both reports B & C that reads (para) "***There were no transactions for yesterday***"
I was hoping that someone might have run into this requirement in the past, and could point me in the right direction...more for the second requirement than the first. Thanks!
DevStudio 766 Servlet - Self Service - MS Windows XP SP2, (output) Excel, PDF, HTML
March 14, 2008, 02:00 PM
Darin LeeQuestion 1:
Easiest thing to do is run your request then add the following to the bottom
-RUN
-SET &&KILL_RPC = IF &LINES EQ 0 THEN 'Y' ELSE 'N';
&&KILL_RPC is a reserved var for Report Caster that tells it to end immediately - no distribution
Question 2:
You would need to run report A again and test &LINES.
-RUN
-SET &NORECORDS=IF &LINES EQ 0 THEN '***There were no transactions for yesterday***' ELSE '';
Then in reports B and C you could include
ON TABLE SUBFOOT
"&NORECORDS"
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 17, 2008, 08:51 AM
PBrightwellYou could create a file with the record count and read that file in before processing reports B and C. Something like:
-* This is to save the original record count
-SET &TTLCNT=&LINES;
SET HOLDLIST PRINTONLY
FILEDEF DAILYCNT DISK /yourpath/DAILYCNT&YYMD.EVAL.TXT
DEFINE FILE CAR
CNT_RCS/D8=&TTLCNT;
END
TABLE FILE CAR
PRINT CNT_RCS
BY CAR NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE SAVE AS DAILYCNT
END
-* (then use Darin's suggestion)
-SET &&KILL_RPC = IF &TTLCNT EQ 0 THEN 'Y' ELSE 'N';
then in B & C
you would repeat the filedef and:
-READ DAILYCNT &RCS.D8.
-RUN
-IF &RCS EQ 0 THEN GOTO NORECS;
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 17, 2008, 10:27 AM
Chris AustinThanks for the ideas! I couldn't remote in over the weekend, so I'm attempting to code this today. I'll post later on about how it all came out.
March 17, 2008, 11:33 AM
cburttAll:
Don't we just love IBI's undocumented &&vars like Darrin Lee's disclosure of &&KILL_RPC?
This complaint is often voiced at user group and Summit meetings. If anyone knows of a COMPLETE list of all such, please post a reference to its location.
[My suspecion is that IBI keeps these hidden because many deal with system security values (I've seen a few of them), which if publically known would promote 'hacker heaven'.]
We've had an issue for years about not wanting to use RCaster notification 'None', but had to do so to eliminate 'No report to distribute' e-mails that come out as "errors" when the output is FTP'd or FILEDEF'd elsewhere.
Chris Austin:
I hope that your reports A and B are true reports that contain some records/lines. If they are themselves &LINES EQ 0, and are forced to print by using SET EMPTYREPORT=ON, then your "***There were no transactions for yesterday***" remark won't show in a FOOTER "at the bottom of both reports".
We've pointed out to IBI that the FOOTER text does not print when an empty report is forced by EMPTYREPORT=ON. They have passed our issue to their product improvement group.
Chris Burtt
WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
March 17, 2008, 12:27 PM
Darin Lee&&KILL_RPC is actually in the documentation, although you probably wouldn't find it unless you already knew exactly what you were looking for and/or knew it was in there somewhere. You'll find it in Appendix B of the Report Caster User's Manual.
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 17, 2008, 02:54 PM
Chris Austinquote:
Originally posted by cburtt:
All:
Don't we just love IBI's undocumented &&vars like Darrin Lee's disclosure of &&KILL_RPC?
This complaint is often voiced at user group and Summit meetings. If anyone knows of a COMPLETE list of all such, please post a reference to its location.
[My suspecion is that IBI keeps these hidden because many deal with system security values (I've seen a few of them), which if publically known would promote 'hacker heaven'.]
We've had an issue for years about not wanting to use RCaster notification 'None', but had to do so to eliminate 'No report to distribute' e-mails that come out as "errors" when the output is FTP'd or FILEDEF'd elsewhere.
I've probably read 1000 pages of WebFocus documentation since November, and there is no way that I would dig through it in lieu of posting a question here or referring to an existing .fex w/ the functionality I'm dealing with (9/10 instances where research is needed, this is how I figure it out).
Documenting an application with such a large scope is no joke...I'm sure we'd all appreciate more relevant 1-pagers, quick hits, something to thumbtack on the wall and refer to, etc...though it could be a lot worse!
quote:
Chris Austin:
I hope that your reports A and B are true reports that contain some records/lines. If they are themselves &LINES EQ 0, and are forced to print by using SET EMPTYREPORT=ON, then your "***There were no transactions for yesterday***" remark won't show in a FOOTER "at the bottom of both reports".
We've pointed out to IBI that the FOOTER text does not print when an empty report is forced by EMPTYREPORT=ON. They have passed our issue to their product improvement group.
Chris Burtt
Thanks for the heads-up. Both of the downstream reports will always contain lines.
DevStudio 766 Servlet - Self Service - MS Windows XP SP2, (output) Excel, PDF, HTML
March 18, 2008, 01:37 PM
N.SelphAs has been mentioned recently in another post, SET EMPTYREPORT=ANSI
prints the footer.
(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)