Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Result of DATEADD in -SET

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Result of DATEADD in -SET
 Login/Join
 
Member
posted
We want to use a simple loop to create datasets based on date parameters. When using DATEADD in a -SET statement, the result appears to be a serial date value. Any suggestions on how to return the value formatted 'like' YYMD in our initial -SET statements?

 
-SET &START = 20180701;
-SET &END = 20190630;
-SET &START_FY = '2018/07/01';
-SET &END_FY = '2019/06/30';

-TYPE &START
-TYPE &END
-TYPE &START_FY
-TYPE &END_FY

-REPEAT LOOP FOR &I FROM 0 TO 1;

	-SET &START = &START + 10000;
	-SET &END = &END + 10000;
	-SET &START_FY = DATEADD(&START_FY,'Y',1);
	-SET &END_FY = DATEADD(&END_FY,'Y',1);

	-TYPE &START
	-TYPE &END
	-TYPE &START_FY
	-TYPE &END_FY

-LOOP

This message has been edited. Last edited by: jltz83od,


WebFOCUS 8.2.06, Windows
 
Posts: 22 | Registered: July 18, 2019Report This Post
Platinum Member
posted Hide Post
Try using the DATECVT function … Run this loop and see if that helps you out.

-SET &CURR_YYMD = &YYMD;
-REPEAT LOOP FOR &I FROM 0 TO 9;
-SET &LOOP_YYMD = DATECVT((DATEADD((DATECVT (&CURR_YYMD, 'I8YYMD', 'YYMD')),'Y', &I)), 'YYMD','I8YYMD');
-SET &LOOP_FY   = EDIT(DATECVT(&LOOP_YYMD,'I8YYMD','A8YYMD'),'9999/99/99');
-TYPE CURR_YYMD = &CURR_YYMD ~ I = &I ~ LOOP_YYMD = &LOOP_YYMD ~ LOOP_FY = &LOOP_FY
-LOOP
 


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Virtuoso
posted Hide Post
Another solution could be :

-SET &START_FY = '2018/07/01';
-SET &END_FY   = '2019/06/30';

-REPEAT LOOP FOR &I FROM 1 TO 3
-SET &START_FY = DATETRAN(DTADD('&START_FY.EVAL', YEAR, 1), '(YYMD)', '(/)', 'EN', 10, 'A10');
-SET &END_FY   = DATETRAN(DTADD('&END_FY.EVAL',   YEAR, 1), '(YYMD)', '(/)', 'EN', 10, 'A10');
-TYPE &START_FY
-TYPE &END_FY
-LOOP


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
Both great solutions. Thank you!


WebFOCUS 8.2.06, Windows
 
Posts: 22 | Registered: July 18, 2019Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Result of DATEADD in -SET

Copyright © 1996-2020 Information Builders