Focal Point
run immediate without dstrun

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

August 05, 2008, 04:57 PM
<Barry>
run immediate without dstrun
My version of updating nextruntime to run a schedule immediately, any comments are welcome

-DEFAULT &SchedID = 'S135ooagmo0a';

-*DEFAULT &SchedID = 'S13482ra1a05';
-*SET &SchedID = 'S13dvjnnp702';

-SET &TIME1 = EDIT(&TOD);
-SET &HOUR = EDIT(&TIME1,'99$$$$$$');
-SET &MIN = EDIT(&TIME1,'$$$99$$$');
-SET &SEC = EDIT(&TIME1,'$$$$$$99');
-TYPE &HOUR HOUR
-TYPE &TIME1

DEFINE FILE BOTSCHED
-* OFFSET/D12 = '&OFFSETHOURS.EVAL';
TODAYDATE/YYMD = &YYMD;
OFFSET/D12 = IF TODAYDATE IS-FROM 20080406 TO 20081026 THEN 4 ELSE IF TODAYDATE IS-FROM 20090405 TO 20091025 THEN 4 ELSE IF TODAYDATE IS-FROM 20100404 TO 20101031 THEN 4 ELSE IF TODAYDATE IS-FROM 20100404 TO 20101031 THEN 4 ELSE 5 ;
ORA_BASE/YYMD = '1970/01/01';
NoOfDays/D12 = DATEDIF(ORA_BASE, TODAYDATE, 'D');
SEC_HR/D12 = 3600 ;
SEC_DAY/D12 = 86400 ;
TIMEHR/D12 = &HOUR * SEC_HR ;
TIMEMIN/D12 = (&MIN * 60) + &SEC;
DaysSeconds/D19 = (((NoOfDays * SEC_DAY) + (OFFSET * SEC_HR) + TIMEHR + TIMEMIN ) * 1000) ;
DS/A32 = FTOA(DaysSeconds,'(D19)','A32');
DS3/A32 = STRREP(32, DS, 1, ',', 0, '',32, 'A32')
END

TABLE FILE BOTSCHED
PRINT DS3
WHERE SCHEDULEID = '&SchedID.EVAL'
ON TABLE HOLD AS NEXTRT FORMAT ALPHA
END

-RUN
-READ NEXTRT &NEWRT.A32
-SET &RT = IF ('&NEWRT.EVAL' EQ '') THEN 'There was an error in the execution of the file' ELSE '&NEWRT.EVAL';
-TYPE &RT
END

-RUN
SQL SQLORA

UPDATE BOTSCHED SET NEXTRUNTIME = LPAD('&RT',32,'0') WHERE SCHEDULEID = '&SchedID';
END

-SET &ERRMSG = IF( &RETCODE EQ 0 ) THEN 'The report submitted for execution' ELSE 'The report was not run, try later';
August 05, 2008, 05:23 PM
TexasStingray
Berry,

Correct me if I am wrong. All you want to do is run a schedule that is inside of report caster now (on demand). If you do not need to run in inside of a focexec, I have created a jsp page that all you have to do is from an html page call it passing a schedule id. if you want it is part of my flex interface for report caster. It can be downloaded from http://www.freewebs.com/texasstingray/flexinterfacereportcaster.htm. The jsp file is call runNow.jsp. There are complete instructions on installing the interface. you can look at an modify the runNow.jsp file.

Hope this helps




Scott