Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     ReportCaster-Scheduling&Parameters

Read-Only Read-Only Topic
Go
Search
Notify
Tools
ReportCaster-Scheduling&Parameters
 Login/Join
 
<Torque>
posted
Hi,

I have to run a report on every Monday and use the current date for some processing in the report. Here are my queries:
1. How do I pass the current system date to the
report? What parameter can be used incase i
use -DEFAULT command?
2. If the report is unable to run on the scheduled day(Monday), then it is required to run on the next available day but using the date of Monday itself. How do I achieve this?

Thanks!
 
Report This Post
Virtuoso
posted Hide Post
the first one is easy
there are a lot of amper variables that will give you the today date in several formats

see this
-SET &ENDDATE=DAMDY(&MDYY,'I8')+28;
-SET &ENDDATE=DTMDY(&ENDDATE,'I8');
-SET &ENDDATE=IF &ENDDATE.LENGTH EQ 7 THEN '0' | &ENDDATE;
-SET &ENDDATE=EDIT(&ENDDATE,'99/99/9999');
-TYPE &ENDDATE

(it comes from an other question here)

so the &MDYY will give you the todays date as a number.

this might help you for the second question too.
just look if it is still monday, if not go back 1, 2 , or more days...

will that help?

Frank




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<Torque>
posted
Thanks Frank,
I get the following output: 03/30/2007, when it should be 03/02/2007. But i guess thats manageable, by not using'+28' !!
The second query remains- would the caster be able to run the report if its run date has already passed. Does caster maintain some sort of queue, where the reports would be executed no matter what time they were scheduled to run?

Thanks in advance Smiler
 
Report This Post
Virtuoso
posted Hide Post
there are some other amper values like

&DATE
&YYMD
&MDY
&MDYY
etc...

the second question...I have an idea but need to test it first.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
As I understand it Caster "wakes up" every minute to determine if there are any jobs that need to run. If it finds them it runs them. So if the server were down for whatever reason on a given day once the server was back up when Caster woke up it would run any jobs it find.

The problem with using system amper variables -- &YYMD -- is that they will supply the current system date, not the date you need for your report. We get around this by using parameter tables. Here's an example.

We store a process date of 03/05/2007. At run time, we pull the field, hold it, -READ it into an amper variable. The amper variable gets used in all the WHERE conditions. Once we've had a successful run, we update the field on the parm table to the next process date -- 3/12/2007, for example.

So regardless of when the report is kicked off, it will always pull everything since we last processed. Maybe a similar approach could work for you.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Platinum Member
posted Hide Post
Torque; Frank gave oyu some great &var's to work with. As for seeing if it is NOT a Monday? Use DOWK subroutine with system (current) date, and depending on the day of the week it returns have a conditional define or -set set up to subtract the number of days backwards to calculate the most recent Monday. Hope this helps..Ira


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Guru
posted Hide Post
If Report Caster is not up, it will go back a number of days to pick up missed schedules based on the value put in "Scanback" in the Report Caster Config.

For reports that use the system date, but always should run on a Monday date, though, you can use the following logic.
-SET &WK_DT2_SD=DATECVT(&YYMD,'I8YYMD','YYMD');
-SET &MONDAY_SD=DATEMOV(&WK_DT2_SD,'BOW');
-SET &MONDAY=DATECVT(&MONDAY_SD,'YYMD','I8YYMD');


(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)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Virtuoso
posted Hide Post
As far as I understood the second problem, it was not the point that the reportcaster is not up, but the data to be reported was not available.

do something with
-IF &RECORDS EQ 0 THEN GOTO NEXTDAY;
-* else run the report
-GOTO END
-NEXTDAY
-WRITE NEXTRUN &MONDAY
-EXIT

Start this report on reportcaster every day and check if it is either monday or if the file "NEXTRUN" exists.
If both conditions are -1 goto the end.
If it is monday, just run the program else...
If that file exists -READ the value &MONDAY and try to run the report again.
If the report is run succesfuly than kill that file and goto the end.

I did this kind of processes already in the DOS time, it must be possible to do it within webfocus too.


I hope it will work.

Frank




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<Torque>
posted
Thanks for all the responses. As I am new to this tool, just want to be absolutely sure.
I am describing my understanding below-

Suppose a report is scheduled using Report Caster (RC), such that it automatically runs every Monday. If RC is down on Monday, then RC would itself pick up the report from a 'queue' and run it, without any manual intervention.

Please correct me if anything here is wrong, as such a situation would be a little difficult to check practically, unless it actually happens itself.. and what if it doesnt run then..!!

Thanks Smiler
 
Report This Post
Expert
posted Hide Post
Hi Torque,

Yes, this is correct. When ReportCaster comes back up, it will look for all records in the BOTSCHED table who’s NEXTRUNTIME field is less than the current date/time and ReportCaster will run it.

Hope this helps. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
<Torque>
posted
Thanks for all the help Smiler

Neha
 
Report This Post
<Torque>
posted
Hi,

I have another query:

My report has to run from RC every Monday and the current date has to be used in processing. I am doing this using &YYMD presently. Now, consider a case when the server isnt able to run on the scheduled day. When it is up, say on Tuesday, when it would run my report, would &YYMD get me Monday's or Tuesday's date?
How can I achieve this if my current approach isnt correct?
Are there any variables that can be passed from RC and used as amper variables in the report?
Is there any documentation available about RC variables?

Thanks in advance.. Smiler
 
Report This Post
Virtuoso
posted Hide Post
Using the &YYMD variable would get you the date on which it actually runs - Tuesday in this case. You could create some other &var as noted previously that moves back to the previous Monday's date using DOWK and subtracting days or DATEMOV.
ReportCaster does have the ability to pass paramters to a procedure. You have to turn on the "Prompt for Parameters" property of the procedure. Then when you schedule the task, click on the "Advanced" button and enter the parameter values you want to pass. I don't know how this would apply to your situation as those values would change every time it runs, so I'm not sure this is what you're looking for.
Best solution would be to use -SET &vars at the beginning of the procedure to calculate a date that always falls on Monday last. Then you don't have to worry about what day it actually runs because it is always dated as of last Monday - or today if it runs on Monday like it should. (Now what happens when that Monday happens to be a national holiday? :-)


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     ReportCaster-Scheduling&Parameters

Copyright © 1996-2020 Information Builders