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.
We have many questions for reports to start on the number X business day of a month
This keeps me doing rather complex startcoding and now I thought it would be more easy to have a small table that holds the business days of the actual month, sequential numbered.
So what i need is a small process that steps trough all the days of a month, and only writes them to a file when it is a business day. Two controls are needed 1) is it weekend, then skip 2) is it a holiday from the holiday calendar, then skip it to.
The program should run on the first day of the month Now when this exists, I can use it in Reportcaster or ETL to test if the actual day is the 3e or 6e working day, if not the program does not run, else it should run.
How do I create the loop in this case.This message has been edited. Last edited by: FrankDutch,
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, 2006
-SET &DATE=&YYMD;
-SET &LASTDAY=DATEMOV(&YYMD,'EOM');
-SET &NEXT=1;
-SET &NUMBERS=EDIT(&LASTDAY,'$$$$$$99');
-* test if this is weekend
....
-* test if this is holiday
-WRITE &NEXT &DATE
-* something to get the next day and loop this &NUMBERS
If I knew how to do it, I had no reason to post it here...
thanks in advance
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, 2006
Generate the list of dates; create a list of holidays and load as a Focus file, with IS_HOL/A1="H"; join the first to the second on the date field; then, in define (or compute):
DOW/A3 = suitably defined ;
BUS_DAY_IND/I2= NOT ( ( DOW EQ 'SAT' OR 'SUN' ) OR (IS_HOL EQ 'H') );
BUS_CNTR/I2=
IF (MONTH EQ LAST MONTH)
THEN LAST BUS_CNTR + BUS_DAY_IND
ELSE BUS_DAY_IND;
BUS_DAY/I2= BUS_DAY_IND * BUS_CNTR;
BUS_DAY_IND will be 0 or 1 to indicate Business days BUS_CNTR gives the cumulative number of business days, month-to-date. BUS_DAY will be sequence number (starting with 1) if date is a business day, else 0.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I have a DB2 table I could export and send you that holds that kind of information, if you like. It has years 1900-2031 and has colums for Weekend Date and Holiday flag
WebFOCUS: 7702 O/S : Windows Data Migrator: 7702
Posts: 127 | Location: San Antonio | Registered: May 29, 2009
Something like this might work. Function DATEMOV will move to the next business day (NBD) based on your BUSDAYS setting, as well as the contents of your Holiday file. You could add code to create the master description, too, or manually create a permenant one.
-SET &ECHO=ALL
-* our holiday calender
SET HDAY = KEMP
-* creating the master for this file
FILEDEF MAS DISK WORKDATE.MAS
-RUN
-WRITE MAS FILENAME=WORKDATE , SUFFIX=FIX , $
-WRITE MAS SEGMENT=DATE, SEGTYPE=S0, $
-WRITE MAS FIELDNAME=WERKDAG, USAGE=YYMD, ACTUAL=A8, $
-WRITE MAS FIELDNAME=NUMMER, USAGE=I3, ACTUAL=A3, $
-*
-* the loop to get the correct records
FILEDEF WORKDATE DISK WORKDATE.FTM
-RUN
-*
-SET &CURYRMTH = EDIT(&YYMD,'999999$$');
-SET &BEGMONTH = &CURYRMTH | '01';
-SET &THISDATE = AYMD(&BEGMONTH,-1,'I8YYMD');
-*
-REPEAT ENDREPEAT1 FOR &I FROM 1 TO 25
-SET &SMARTDATE = DATECVT(&THISDATE,'I8YYMD','YYMD');
-SET &NEXTBUSDAY = DATEMOV(&SMARTDATE,'NBD');
-SET &THISDATE = DATECVT(&NEXTBUSDAY,'YYMD','I8YYMD');
-SET &THISYRMTH = EDIT(&THISDATE,'999999$$');
-IF (&THISYRMTH NE &CURYRMTH) GOTO EXITREPEAT1 ;
-*TYPE &THISDATE &I
-WRITE WORKDATE NOCLOSE &THISDATE &I
-ENDREPEAT1
-EXITREPEAT1
-RUN
-* since we want to keep it as a foc file in our basedir we added this small report
APP HOLD BASEAPP
SET HOLDLIST=PRINTONLY
TABLE FILE WORKDATE
SUM NUMMER
BY WERKDAG
ON TABLE HOLD AS WERKDAG FORMAT FOCUS INDEX WERKDAG
END
Now we can run a small fex that tests if the actual day is the number X workday of the month
If it is you get 1 record else zero.
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, 2006