Focal Point
[CLOSED]Fex running scheduled jobs

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

December 16, 2015, 09:20 AM
WF8Developer
[CLOSED]Fex running scheduled jobs
Our company has many scheduled jobs in Report Caster. We had a communication failure that prevented the jobs to be distributed.

Is it possible to create a .fex that identifies and executes RCaster jobs? Ideally, this would include methodology to allow the user to run a partial list of the entire population of available RCaster jobs.

Thanks, as always.

This message has been edited. Last edited by: <Emily McAllister>,


Production: WebFOCUS 7.703 & 8.104,
All output formats.
Win7-64,MS Office 2013.
Sandbox 8009
December 16, 2015, 11:29 AM
Ian Dalton
You can run this code to identify all RC jobs.....not so sure about kicking them off though....
-SET &ECHO=ALL;
-RUN

-MRNOEDIT -SET &D = EDIT(&YYMD.EVAL,'$$$$$$99')|'/'|EDIT(&YYMD.EVAL,'$$$$99$$')|'/'|EDIT(&YYMD.EVAL,'9999$$$$');
-MRNOEDIT -SET &T = CTRAN(8,'&TOD.EVAL',46,58,'A8');

-SET &F = '&RFORMAT.(HTML,PDF,EXL07).Report Format:.';
-*SET &RFORMAT = 'HTML';
-SET &MRE_Name = GETUSER('A8');

-*JOIN SKEDBOOK WITH BRIEFDISTLIST IN BOTSCHED TO ALL BOOKNAME IN BOTDEST AS J1_
JOIN PACKETID                                   IN BOTSCHED TO     PACKETID IN BOTTASK AS J2_

SET SQUEEZE=ON
SET ALL=ON
DEFINE FILE BOTSCHED
SKEDBOOK/A50V=SUBSTV(800, BRIEFDISTLIST, 1, 50, SKEDBOOK);
END

TABLE FILE BOTSCHED
HEADING CENTER
"List of Report Caster Schedules from Server &SERVER_NAME as at : &DATEDMYY "
"  "
"Run on: &D at: &T                              Page No. <TABPAGENO>"
" "
PRINT TASKNAME TASKOBJ TASKTYPE 
-*     DESTFN
-*    WEEKDAYS
-*      STARTTIME
   BY JOBDESC
   BY SCHEDULEID UNDER-LINE
   BY CASTER_USER
   BY EXECID
-*   BY INTERVALTYPE AS I
-*   BY BOOKNAME NOPRINT
   BY BRIEFDISTLIST NOPRINT
ON TABLE PCHOLD FORMAT &RFORMAT
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
FOOTING
"Run as: &MRE_Name on: &D at: &T"
" "
END
-EXIT 



_______________________
*** WebFOCUS 8.1.05M ***
December 17, 2015, 08:30 AM
stur0063
We do something similar to what Ian does - but it has a few more joins to pull in data like last execution time, status, types, etc...

Like Ian - we don't "execute" the jobs - we let the caster take care of that.

-*Dump of report caster scheduler jobs


JOIN
BOTSCHED.BOTSCHED.PACKETID IN BOTSCHED TO UNIQUE BOTTASK.BOTTASK.PACKETID
IN BOTTASK TAG J0 AS J0
END
JOIN
BOTSCHED.BOTSCHED.SCHEDULEID IN BOTSCHED TO UNIQUE BOTDIST.BOTDIST.SCHEDULEID
IN BOTDIST TAG J1 AS J1
END
JOIN
LEFT_OUTER J1.BOTDIST.DISTLIST IN BOTSCHED TO UNIQUE BOTDEST.BOTDEST.ADDRBOOKID
IN botdest TAG J2 AS J2
END
JOIN
LEFT_OUTER J1.BOTDIST.DISTLIST IN BOTSCHED TO UNIQUE BOTADDR.BOTADDR.IBFSID
IN botaddr TAG J3 AS J3
END



DEFINE FILE BOTSCHED
METHOD/A10 = IF (METHOD_CODE EQ 'M') THEN 'Email' ELSE
             IF (METHOD_CODE EQ 'P') THEN 'Printer' ELSE 'Other';
LIST_T/A25 = IF (LISTTYPE EQ 'D')    THEN 'Distribution List' ELSE
             IF (LISTTYPE EQ 'S')    THEN 'Single Email Address(es)' ELSE 'Other';
PRETTY_TO/A255 = IF (LISTTYPE EQ 'D') THEN J3.DESCRIPTION || ' -- ' || DESTFN ELSE DISTLIST;
END

TABLE FILE BOTSCHED
PRINT
     BOTSCHED.BOTSCHED.LASTEXTIME/HMDYYI
	 LASTEXSTATUS
	 PRETTY_TO
     COMPUTE LIST_TYPE/A25 = IF SCHEDULEID EQ LAST SCHEDULEID THEN '' ELSE LIST_T;
BY  BOTSCHED.BOTSCHED.JOBDESC
BY  BOTSCHED.BOTSCHED.CASTER_USER
BY  BOTSCHED.BOTSCHED.ACTIVE
BY  J1.BOTDIST.METHOD
BY  J1.BOTDIST.MAILSUBJECT
BY  J0.BOTTASK.TASKNAME
-*WHERE ACTIVE EQ 'Y';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END




webFOCUS 8207.15
WindowsServer 2019
December 17, 2015, 08:44 AM
Ian Dalton
Yes nice one ! I did have something like that in WF77 but it didn't work in WF81.


_______________________
*** WebFOCUS 8.1.05M ***
December 28, 2015, 06:30 AM
Efrem
The best and most efficient way to do this if you license WebFOCUS RESTful Web Services and the REST adapter.
I have all kinds of examples ready to go.