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.
New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.
What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.
During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.
I need to set a variable called &WEEKEND that will pull the date from the upcoming Saturday and then pull that variable into a SUBHEAD in my report.
ON TABLE SUBHEAD "Weekly Leader Board" "Week ending &WEEKEND"
The report I'm working in was created by another developer that is no longer with the company and there are several other variables already set in the report. I'm just having trouble figuring out how to set this new variable that I need.
Here is a list of other variables defined at the top of this report, including the new one I need to set:
-SET &HOUR = EDIT(&TOD,'99'); -SET &M = IF &TOD GT '12.00.00' THEN 'pm' ELSE 'am'; -SET &FLAG = IF &TOD GT '13.00.00' THEN 1 ELSE 0 ; -SET &MINUTES = EDIT(&TOD,'$$$99'); -SET &SECONDS = EDIT(&TOD,'$$$$$$99'); -SET &JTIME = &HOUR | ':' | &MINUTES | &M; -SET &MORROW = IF &HOUR GE 6 THEN DATECVT((DATEADD((DATECVT(&YYMD,'I8YYMD','YYMD')), 'D', +2)), 'YYMD','I8YYMD') ELSE DATECVT((DATEADD((DATECVT(&YYMD,'I8YYMD','YYMD')), 'D', 0)), 'YYMD','I8YYMD'); -SET &WEEKEND = ???
Thanks for any suggestions!This message has been edited. Last edited by: Tamra,
I would use the datemov function. Here is a snippet from the helpfile on it.
Available Languages: reporting, Maintain
The DATEMOV function moves a date to a significant point on the calendar.
Since Dialogue Manager interprets a date as alphanumeric or numeric, and DATEMOV requires a standard date stored as an offset from the base date, do not use DATEMOV with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date. For example, the following converts the integer legacy date 20050131 to a smart date, adds one month, and converts the result to an alphanumeric legacy date:
-SET &STRT=DATECVT(20050131,'I8YYMD', 'YYMD');
-TYPE A MONTH FROM 20050131 IS &NMTA
The output shows that the DATEADD function added the actual number of days in the month of February to get to the end of the month from the end of January:
A MONTH FROM 20050131 IS 02282005
For more information, see Calling a Function From a Dialogue Manager Command.
DATEMOV works only with full component dates.
Top of page
Syntax: How to Move a Date to a Significant Point
Is the date to be moved. It must be a full component format date (for example, MDYY or YYJUL).
Is the significant point the date is moved to enclosed in single quotation marks. An invalid point results in a return code of zero. Valid values are:
EOM, which is the end of month.
BOM, wihch is the beginning of month.
EOQ, which is the end of quarter.
BOQ, which is the beginning of quarter.
EOY, which is the end of year.
BOY, which is the beginning of year.
EOW, which is the end of week.
BOW, which is the beginning of week.
NWD, which is the next weekday.
NBD, which is the next business day.
PWD, which is the prior weekday.
PBD, which is the prior business day.
WD-, which is a weekday or earlier.
BD-, which is a business day or earlier.
WD+, which is a weekday or later.
BD+, which is a business day or later.
A business day calculation is affected by the BUSDAYS and HDAY parameter settings.
Also note that when the DATEMOV function calculates the next or previous business day or work day, it always starts from a business day or work day. So if the actual day is Saturday or Sunday, and the request wants to calculate the next business day, DATEMOV will use Monday as the starting day, not Saturday or Sunday, and will return Tuesday as the next business day. Similarly, when calculating the previous business day, it will use the starting day Friday, and will return Thursday as the previous business day.
To avoid skipping a business day or work day, use DATEMOV twice. To return the next business or work day, use BD- or WD- to first move to the previous business or work day (if it is already a business day or work day, it will not be moved). Then use DATEMOV again to move to the next business or work day. If you want to return the previous business or work day, first use BD+ or WD+ to move to the next business or work day (if it is already the correct type of day, it will not be moved). Then use DATEMOV again to return the previous business or work day.
Note: DATEMOV does not use an output argument. It uses the format of the date argument for the result. As long as the result is a full component date, it can be assigned only to a full component date field or to an integer field.
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 22.214.171.124
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013
This is a post from many years ago: Simplifying the use of Date functions in Dialogue Manager. In it I described how to create a DEFINE FUNCTION that can be called by Dialogue Manager. The example I created did this for one Date function only, but could probably be modified to apply a user selected Date function.
You create a library of functions as a fex and -INCLUDE where required. An example:
DEFINE FUNCTION UDATEADD(INDATE/A8YYMD, INUNIT/A2, INNBR/I4)
INDATE1/YYMD = INDATE;
UDATEADD1/YYMD = DATEADD(INDATE1, INUNIT, INNBR);
UDATEADD/A8YYMD = UDATEADD1;
You call it with this simple Dialogue manager code:
-SET &DATE1 = UDATEADD(&YYMD, 'M', -3);
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
While I like that DEFINE FUNCTION, why doesn't the following work in WebFOCUS 8, it returns "*** &DATEADD6=20150334 ***"? -SET &DATEIN = 20150328 ; -* DATEADD(date, 'component', increment) -SET &DATEADD6 = DATEADD(&DATEIN, 'D' , 6 ) ; -TYPE *** &|DATEADD6=&DATEADD6 ***
There are 3 types of dates, legacy dates, dates and date-time.
Legacy dates are held in readable format, dates and date-time are held as numeric difference from a base date (internal format).
In Dialogue Manager when you set a date it is a legacy date format, the same as using I8YYMD or A8YYMD (and other valid formats) in DEFINE etc.
There are a set of functions that work with legacy dates, different functions for date and others for date-time. To use date functions, the date must be in internal format, hence the use of DATECVT.
To add days or months with legacy dates, then use the correct function: