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.
I have a report set up in Report Caster that I need to run the next working day after the end of the month. So, if the last day of the month falls on a Friday, I need the report to run that Monday. If the last day of the month is Wednesday, I need the report to run Thursday.
This means I cannot schedule the report to run on a specific date and I cannot schedule the report to run on a specific day of the week.
I'm sure this is no simple solution to set this up, but does anyone know of any code or anything to do this?
Thanks for your help,
Krysti
WF 767
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004
Not sure about the 'first business day' feature in 7.6. Otherwise, you can use regular WebFOCUS code to calculate the first business day of the month, and then use Report Caster APIs to create the schedule. However, this would mean that you would use your own custom built interface for the application users.
Diptesh WF 7.1.7 - AIX, MVS
Posts: 79 | Location: Warren, NJ, USA | Registered: October 25, 2006
In Report Caster, schedule the job to run every day. Then do the following.
FILEDEF RUNFEX DISK pathname/runfex.ftm ( LRECL 8 RECFM V -RUN -READ RUNFEX &RUNDT.8. -RUN -IF &RUNDT NE &YYMD THEN GOTO FINISHED; . . . Your Fex . . . DEFINE FILE MACGYVER RUNDT/YYMD=&YYMD; NEXT_RUNDT/YYMD=DATEADD(DATEMOV(RUNDT,'EOM'),'BD',1); END -* TABLEF FILE MACGYVER SUM NEXT_RUNDT WHERE COUNTER EQ 1 ON TABLE SAVE AS RUNFEX END -* DEFINE FILE MACGYVER CLEAR END -RUN -* -FINISHED
We have a file name MACGYVER.FOC we use whenever we use the MACGYVER technique. For this purpose, you can use any file and just limit your read to 1 record. Note the 'BD' in DATEADD, that is for business days. The 'BD" parameter will take in to account holidays as well if you set up a Holiday file. For example, this year Labor Day (Sep 3rd) is the 1st Monday in September. Using the above, when you add 1 business day to August 31st, you will get Sept 3rd. However, if you set up a holiday file with with 20070903, you will get Sept 4th when adding 1 business day to Aug 31st.
Hope this helps.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006
I'm not used to doing anything like this so I tried to modify it using my tables, but I'm not sure I even did it right.
When I run it I get the following error:
A VALUE IS MISSING FOR: &RUNDT
I'm not sure where the value for it is supposed to come from (?).
Here is my code - do you mind taking a look at it to see if it looks correct to you?
FILEDEF ftpcp020 DISK \\drummond\sys\share\transfer\database\ftpcp020.ftm ( LRECL 8 RECFM V -RUN -READ ftpcp020 &RUNDT.8. -RUN -IF &RUNDT NE &YYMD THEN GOTO FINISHED; - TABLE FILE AGENT PRINT COMPUTE COMP/A25 = '@drummondamerican.com'; NOPRINT COMPUTE COMMA/A1 = ','; NOPRINT COMPUTE COMMA/A1 = ','; NOPRINT COMPUTE DOLLAR/A1 = '$'; NOPRINT COMPUTE CONCAT/A40 = AGT_NUMBER||COMP||COMMA||AGT_NUMBER||COMMA||DOLLAR; AS '' BY AGT_NUMBER NOPRINT WHERE AGT_COMPCOD EQ '03'; WHERE AGT_TERM_FLAG NE '1'; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL END -* DEFINE FILE AGENT RUNDT/YYMD=&YYMD; NEXT_RUNDT/YYMD=DATEADD(DATEMOV(RUNDT,'EOM'),'BD',1); END -* TABLEF FILE AGENT SUM NEXT_RUNDT WHERE RECORDLIMIT EQ 1 -*WHERE COUNTER EQ 1 ON TABLE SAVE AS RUNFEX END -* DEFINE FILE AGENT CLEAR END -RUN -* -FINISHED
WF 767
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004
Did you create your file? You need to initially create your file. Also, at the end, the ON TABLE SAVE AS RUNFEX should be ON TABLE SAVE AS ftpcp020. This is how the next run date gets saved.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006
I did create the file, but I figured out it wasn't reading it because I didn't have it saved on the server and I don't have access to the server. Ugh! I'm trying to get access...
By the way, is there a way to print out the data from the saved file when doing the FILEDEF to see if it is reading the file? Does anyone know?
Thanks for all your help guys (and gals),
Krysti
WF 767
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004
If you do not care about holidays this little code should work just use it as a preprocessing procedure. Schedule the job to run on the 1, 2, and 3 of each month
-SET &DAY = EDIT(&YMD, '$$$$99');
-SET &DAYOFWEEK = DOWK(&YYMD, 'A3');
-SET &KILL_RPC = IF &DAY EQ 1 AND (&DAYOFWEEK EQ 'MON' OR &DAYOFWEEK EQ 'TUE' OR &DAYOFWEEK EQ 'WED' OR &DAYOFWEEK EQ 'THU' OR &DAYOFWEEK EQ 'FRI') THEN 'N' ELSE
- IF &DAY EQ 2 AND (&DAYOFWEEK EQ 'MON') THEN 'N' ELSE
- IF &DAY EQ 3 AND (&DAYOFWEEK EQ 'MON') THEN 'N' ELSE 'Y';
-TYPE &DAYOFWEEK
-TYPE &DAY
-TYPE &KILL_RPC
The -TYPE in the code is just to see the variable values.
FILEDEF ftpcp020 DISK \\drummond\sys\share\transfer\database\ftpcp020.ftm ( LRECL 8 RECFM V -RUN -WRITE ftpcp020 20070702 -RUN
As for the pre-processing procedure you can use the following.
FILEDEF RUNFEX DISK pathname/runfex.ftm ( LRECL 8 RECFM V -RUN -READ RUNFEX &RUNDT.8. -RUN -SET &&KILL_RPC=IF &RUNDT EQ &YYMD THEN 'N' ELSE 'Y';
In doing some research on this, the only downside is that using &&KILL_RPC cause Report Caster to generate an error notification.
(I just love this board, I learn something new almost every day and I've been using FOCUS and WebFOCUS for over 20 years. I never knew about &&KILL_RPC.)This message has been edited. Last edited by: jgelona,
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006