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.
Read-Only TopicGo
Search
Notify
Admin
New PM!
Member posted July 10, 2015 12:09 PM
I'm new to WF and would appreciate any advice on the following:
I need to create two dates, STARTDATE and ENDDATE.
ENDDATE is the last day of the previous month, for today June 30, 2015
STARTDATE is one year previous, for today July 1, 2014.
Thanks in advance.
This message has been edited. Last edited by: <Kathryn Henning>, July 15, 2015 03:04 PM WebFOCUS 8 Windows, All Outputs
Virtuoso Peter,
WF8 has many different date functions one can use to get and manipulate dates for definition in a data description or report request.
Some I've used are CHGDATE(), DATECVT(), DATEADD(), etc.
This link takes you to a great thread on date manipulation done by others on the forums that I've benefited from from time to time:
http://forums.informationbuild...?r=14810094#14810094 Also, go to IBI's website and find the WF8 docs and search for date functions. You'll find bunches of info there as well.
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Platinum Member Here's one example to look at ...
-* SET CURRENT DATE
-SET &CUR_YYMD = &YYMD;
-*-SET &CUR_YYMD = 20110901;
-*
-SET &BCM_YYMD = DATECVT(DATEMOV(DATECVT(&CUR_YYMD, 'I8YYMD', 'YYMD'), 'BOM'),'YYMD', 'I8YYMD');
-*
-SET &BEG_YYMD = DATECVT((DATEADD((DATECVT (&BCM_YYMD, 'I8YYMD', 'YYMD')),'M', -12)), 'YYMD','I8YYMD');
-SET &END_YYMD = DATECVT((DATEADD((DATECVT (&BCM_YYMD, 'I8YYMD', 'YYMD')),'D', -1)), 'YYMD','I8YYMD');
-*
-SET &STARTDATE = FPRINT(DATECVT(&BEG_YYMD,'I8YYMD','MDYY'),'MDtrYY','A20');
-SET &ENDDATE = FPRINT(DATECVT(&END_YYMD,'I8YYMD','MDYY'),'MDtrYY','A20');
-*
-TYPE ------------------------------------------------
-TYPE CURRENT DATE (CUR_YYMD) ----- &CUR_YYMD
-TYPE ------------------------------------------------
-TYPE BEGIN CURRENT MONTH (BCM_YYMD) ----- &BCM_YYMD
-TYPE ------------------------------------------------
-TYPE BEGIN DATE (BEG_YYMD) ----- &BEG_YYMD
-TYPE END DATE (END_YYMD) ----- &END_YYMD
-TYPE ------------------------------------------------
-TYPE --- YOUR DATES
-TYPE ------------------------------------------------
-TYPE STARTDATE ----- &STARTDATE
-TYPE ENDDATE ------- &ENDDATE
-TYPE ------------------------------------------------
WebFocus 8.201M, Windows, App Studio
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008
IP
Virtuoso
-SET &CURRENT_YR_MTH = EDIT(&YYMD,'999999$$');
-SET &REPORT_YR_MTH = AYM(&CURRENT_YR_MTH,-1,'I6YYM');
-*
-SET &CURRENT_MTH_BEG = &CURRENT_YR_MTH | '01';
-SET &REPORT_MTH_BEG = &REPORT_YR_MTH | '01';
-SET &REPORT_MTH_END = AYMD(&CURRENT_MTH_BEG,-1,'I8');
-*
-SET &REPORT_YEAR = EDIT(&REPORT_YR_MTH,'9999$$');
-SET &YEAR1_AGO_YR_MTH = AYM(&CURRENT_YR_MTH,-12,'I6YYM');
-SET &YEAR1_AGO_BEG = &YEAR1_AGO_YR_MTH | '01';
-*
-TYPE &REPORT_YEAR
-TYPE &REPORT_MTH_END
-TYPE &REPORT_MTH_BEG
-TYPE &YEAR1_AGO_BEG
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
IP
Expert Hi Peter,
I would suggest that you have a good read of the Functions manual so you know what is available.
V8.1.04 Functions Manual Waz... Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Pity the lost knowledge of an old programmer!
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006
IP
Member Thanks all for your assistance. Much appreciated.
Gold member Just for fun, here is how it could be done without subroutines:
DEFINE FILE CAR
TODAY/YYMD WITH COUNTRY = &YYMD ;
YRMON/YYM = TODAY ;
FSTDAY/YYMD = YRMON ;
IFSTDAY/I8YYMD = FSTDAY ;
IYR/I4 = IFSTDAY/10000 ;
IMDAY/I4 = IFSTDAY - (IYR*10000);
ISTART/I8YYMD = (IYR-1)*10000 + IMDAY ;
STRTDAY/YYMD = ISTART ;
ENDDAY/YYMD = FSTDAY - 1;
END
-RUN
TABLE FILE CAR
PRINT YRMON YRMON FSTDAY ENDDAY IFSTDAY IYR IMDAY ISTART STRTDAY
IF RECORDLIMIT EQ 1
END
-RUN
IBI Development
Please Wait. Your request is being processed...
Read-Only TopicCopyright © 1996-2020 Information Builders