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.
Hi all, I need to count backwards from each Quarter (03/YY, 06/YY, 09/YY, 12/YY) to a base date in 2008. Can I use repeat in this way:
-REPEAT DT WHILE &BHDATE LE &EODATE; -INCLUDE XXXXXXXX -RUN -DT
In this code &BHDATE is the base date and &EODATE is the regressing date; the -INCLUDE XXXXXXXX is a repetitive quarterly regression/summarize. I know that a semi-colon is supposed to not be necessary, but it gets an error when I don't use it..
At each point I add 1 to a counter to use later in the program.
I use FOCUS v7 on z/OS.
In addition, I need to use this counter number to develop a report which shows totals for each regressing total along with the dates of each regressed quarter. Can I use this in a subfoot that includes the totals for each quarter AND the start/end dates for each quarter, and how do I do this if it's possible. If not, I am open to suggestions as to how to accomplish this.
Thanks in advance,
JoeThis message has been edited. Last edited by: Joe_So_Cool,
Mainframe FOCUS z/OS Standard paper reporting and VPS interface for emailing Excel, Word, etc.
What is the output format for your reports? Is the output target on-line reports or report files? What kind of dates are BHDATE and EODATE?
Below is one technique for producing Excel output. BYTOC generates a separate Excel tab for each quarter between the begin and end dates for the report. BY HIGHEST sorts the quarters and tabs from most recent to oldest. The MOVIES file is a standard sample file like the CAR file.
-SET &BHDATE = 19870904 ;
-SET &EODATE = &YYMD ;
-*
DEFINE FILE MOVIES
RELQTR/YYQ = RELDATE ;
END
-*
TABLE FILE MOVIES
SUM COPIES
BY HIGHEST RELQTR
WHERE RELDATE FROM '&BHDATE' TO '&EODATE';
ON TABLE PCHOLD FORMAT EXL2K BYTOC
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
In reponse to your queries: a)Q] - "What is the output format for your reports? Is the output target on-line reports or report files?" A1] - the output format will be both a file and one a report, which will be sent via email in .pdf format; A2] - the other (the file) will be tranmitted via Connect/Direct (used to be Network Data Mover).
b)Q[ - "What kind of dates are BHDATE and EODATE?" A1] - They are in MDY order, and have never been formatted as YMD or YYMD, smart date or otherwise, in my system; A2 - BHDATE is the base date/EODATE is the present quarterly date.
Mainframe FOCUS z/OS Standard paper reporting and VPS interface for emailing Excel, Word, etc.
Here's some sample code. Dialogue Manager isn't very good at performing date calculations involving quarters, which is why I used DEFINE/TABLE/-READ to do so. This code determines the number of quarters between the start and end dates and then uses a -REPEAT loop to create a PDF report file for each quarter. I used YYMD formats because that is the date format used in the MOVIES file. My report file names are of the format Fyyyyq.PDF and are written to the BASEAPP folder. This code will hopefully give you some ideas.
-SET &BHDATE = 19870904 ;
-SET &EODATE = 19881016 ;
-*
-* Determine current quarter and number of quarters to report.
DEFINE FILE MOVIES
BHDATE/YYMD WITH MOVIECODE = '&BHDATE';
EODATE/YYMD WITH MOVIECODE = '&EODATE';
BASE_QTR/YYQ = BHDATE ;
CURR_QTR/YYQ = EODATE ;
QTR_COUNT/I5 = CURR_QTR - BASE_QTR ;
END
-*
TABLE FILE MOVIES
PRINT CURR_QTR QTR_COUNT
WHERE RECORDLIMIT EQ 1 ;
ON TABLE SAVE AS QTRCNT
END
-RUN
-READ QTRCNT &CURR_QTR.5 &QTR_COUNT.5
-*TYPE &CURR_QTR &QTR_COUNT
-*------------------------------------------------
-REPEAT ENDREPEAT1 FOR &I FROM 0 TO &QTR_COUNT
-*
-* Determine report quarter and begin and end dates for quarter (for current loop iteration).
DEFINE FILE MOVIES
CURR_QTR/YYQ WITH MOVIECODE = &CURR_QTR ;
RPT_QTR/YYQ = CURR_QTR - &I ;
QTR_BEG/YYMD = RPT_QTR ;
QTR_END/YYMD = DATEMOV(QTR_BEG,'EOQ');
END
-*
TABLE FILE MOVIES
PRINT RPT_QTR QTR_BEG QTR_END
WHERE RECORDLIMIT EQ 1 ;
ON TABLE SAVE AS BEGEND
END
-RUN
-READ BEGEND &RPT_QTR.5 &QTR_BEG.8 &QTR_END.8
-*TYPE &RPT_QTR &QTR_BEG &QTR_END
-*
-* Specify output file name and location.
APP FILEDEF OUTFILE DISK BASEAPP/F&RPT_QTR...PDF
-*
-* Generate report for current loop iteration, using quarter begin and end dates.
TABLE FILE MOVIES
SUM COPIES
BY RELDATE
WHERE RELDATE FROM '&QTR_BEG' TO '&QTR_END';
ON TABLE SAVE AS OUTFILE FORMAT PDF
END
-RUN
-*
-ENDREPEAT1
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
table file ....
sum value
by timeperiod1
by timeperiod2
on table hold as x format focus
end
table file x
sum value as 'actual value in timeperiod'
compute value2/d12 = value + value2; as 'running value until timeperiod'
by timeperiod1
by timeperiod2
end
And you could make the compute smarter... ( for multiple breaks )
if lst.timeperiod1 eq last lst.timeperiod1 then value2+value else value;
This way any next timeperiod value equals all previous values.
in this what you mean?
_____________________ WF: 8.0.0.9 > going 8.2.0.5
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010
According to my Quick Reference guide for 7.6.2, functions DATEMOVE, DATEADD, and DATECVT are not supported in Dialogue Manager. Has this changed in 7.7 (or earlier), or am I missing something? Also, are you now using global positioning coordinates to pinpoint your location in your signature?
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
functions DATEMOVE, DATEADD, and DATECVT are not supported in Dialogue Manager
As you have noticed, I am using 7.7.01 and that is the release in which I wrote the code. However, I am sure (as per Tom above) that I have done this in earlier releases. Not sure why your responses are different.
quote:
Also, are you now using global positioning coordinates to pinpoint your location
Someone who reads more than the post! How observant of you. It is a tad uncomfortable sitting here though!
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
This reduces the nesting of of date functions by one for calculating previous quarters. Your technique is really slick by using DATECVT twice. I'm an old coder that use to write a DEFINE FILE, TABLE FILE and -READ
Dave D.
Posts: 8 | Location: Information Builders Chicago Branch | Registered: November 15, 2005