Focal Point
[CLOSED] Run a Report and Report Caster via batch?

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

November 10, 2019, 09:31 PM
nox
[CLOSED] Run a Report and Report Caster via batch?
Hi,

I know there is "cmrun.bat" in iway datamigrater to run process via batch, is there any similar like cmrun.bat for run the report by Report Caster trigger by batch?

My objective is allow Report Caster to run when certain conditions are made, not by timely.(RC will set:"Run Once")

This message has been edited. Last edited by: nox,


WebFOCUS v8.2.06 , Windows
November 11, 2019, 07:37 AM
MartinY
Search for "Alert"


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 11, 2019, 11:40 AM
FP Mod Chuck
Nox

This document should help you. https://webfocusinfocenter.inf...eb_based_tools50.htm


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
November 12, 2019, 05:33 AM
nox
Hi,

Thank you for all your reply, I have read through Alert Assist and did few testing that does meet some of requirement that I seek for, however I think in order for AA to run, it need to setup a schedule via RC, which is why I try to avoid using schedule. Any other possibility that it can be done without Scheduling?


WebFOCUS v8.2.06 , Windows
November 12, 2019, 09:54 AM
jgelona
For Report Caster to run a job, then there has to be a schedule. Sounds like you need a schedule to run on demand. You have a few option:
1. DSTRUN may work;
2. Use Restful Web Services
3. Use MODIFY to update the next run date/time of the schedule.

We used DSTRUN exclusively in the past prior to WebFOCUS 8 then it stopped working in our SOS environment, even when using an alternate security zone. The issue was the new security model in WebFOCUS 8 and our SOS environment. The issue with the alternate security zone is supposed to be fixed but I can't test it because we are still on 8008 (tomcat compatibility issues with our OS had been our roadblock so far but I think we are close to getting it resolved). Restful Web Services worked but I didn't like it because it always gave a message that the job was submitted. All of my schedules that use DSTRUN are set to Run Once. I wrote a MODIFY routine to update the next run date/time of the schedule to the current date/time plus 1 minute. The trick is using the Zulu date time which is pretty easy in Linux/Unix. We have 59 different batch jobs, some running multiple tasks, that run this way. All of these are triggered to run by an event of some kind.

However, if you just want to run WebFOCUS in a batch environment, look up edastart -f.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
November 13, 2019, 09:33 PM
nox
Thank you jgelona, look promising for trigger a report to run via on demand. I'll give it a try, however not much of information or example of how to make it work, would appreciate more example can study on though.


WebFOCUS v8.2.06 , Windows
November 14, 2019, 09:25 AM
jgelona
DSTRUN is an IBI function. Like I said, depending on your release and/or security it may or may not work. I created a small fex that I could -INCLUDE or EX and pass the appropriate parameters. Try this link:
DSTRUN

For Restful Web Services download the manual for your release try this link, see Chapter 5. Also this may require a license:
RESTful Web Service Developer's Guide

As for updating the next run date and time using MODIFY, IBI does not recommend or support this so if you mess up, it is on you to fix it.

The next run date time is in the BOTSIT report caster table. Assuming you have the adapter for the database, this is the fex that I use. Our servers are Linux:
-* File rc_submit.fex
-*
-* This job tell Report Caster to submit the desired job for execution at the
-* current time plus 1 minute
-*
-* The only parameter is the Report Caster schedule id
-*
-* To use this in a fex, do the following
-* -SET &RCJOBID=scheduld_id;
-* -INCLUDE rc_submit
-*
-* To use this in Report Caster, add the following in the pre or post processing fex
-* baseapp/rc_submit RCJOBID=schedule_id
-*
-*-SET &RCJOBID=S52089096s861bs4dc2sa025s8c0779769b44;
-*
 APP PATH report_caster
-*
-* Get the Interval Id for the schedule
-*
 TABLEF FILE BOTSIT
  PRINT INTERVALID
  WHERE SCHEDULEID EQ '&RCJOBID'
     ON TABLE SAVE
 END
-RUN
-READ SAVE &LNGTH.6. &INTERVALID.64.
-RUN
-SET &INTERVALID=TRUNCATE(&INTERVALID);
-UNIX rm save.ftm
-*
-*  Get the next run date/time in zulu time plus 1 minute
-*
 APP FI ZULUTIME DISK zulutime.txt ( LRECL 32 RECFM V
-RUN
-UNIX date +%s > zulutime.txt
-RUN
-READ ZULUTIME &ZULUSEC.32.
-RUN
-*
 DEFINE FILE MACGYVER
   ZULUSEC/P32=&ZULUSEC;
   ZULUDAYS/I9=ZULUSEC/86400;
   ZULUHRS/I9=(ZULUSEC-(ZULUDAYS*86400))/3600;
   ZULUMIN/I9=(ZULUSEC-((ZULUDAYS*86400)+(ZULUHRS*3600)))/60;
   ZULUTIME/P32L=((ZULUDAYS*86400)+(ZULUHRS*3600)+((ZULUMIN+1)*60))*1000;
 END
-*
 TABLE FILE MACGYVER
 PRINT ZULUTIME
    IF COUNTER EQ 1
    ON TABLE SAVE
 END
-*
 DEFINE FILE MACGYVER CLEAR
 END
-RUN
-READ SAVE &NEXTRUNTIME.32.
-RUN
-UNIX rm save.ftm
-TYPE .
-TYPE .  Submitting:
-TYPE .    Schedule Id: &RCJOBID
-TYPE .    Interval Id: &INTERVALID
-TYPE .      Zulu Time: &NEXTRUNTIME
-TYPE .
-*
 MODIFY FILE BOTSIT
 FIXFORM INTERVALID/64
 MATCH INTERVALID
    ON MATCH COMPUTE NEXTRUNTIME='&NEXTRUNTIME.EVAL';
    ON MATCH UPDATE NEXTRUNTIME
    ON MATCH SQL COMMIT WORK
    ON MATCH/NOMATCH GOTO TOP
 DATA
&INTERVALID
 END
-RUN



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.