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     [SOLVED] Dialogue Manager - Date to I8MDYY not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Dialogue Manager - Date to I8MDYY not working
 Login/Join
 
Silver Member
posted
I've searched the forum, documentation and 1001 ways to work with dates and can't find the answer so I'm hoping someone will have some advice for me.

 -SET &INPUT_DATE = &YYMD;
-SET &DATECVT = DATECVT (&INPUT_DATE, 'I8YYMD', 'YYMD');
-SET &DATEADD = DATEADD(&DATECVT, 'D', '-9');
-SET &LAST_WEEK_MDYY = DATECVT (&DATEADD, 'YYMD', 'I8MDYY');
-SET &LAST_WEEK_YYMD = DATECVT (&DATEADD, 'YYMD', 'I8YYMD');

-TYPE LastWeek_MDYY = &LAST_WEEK_MDYY
-TYPE LastWeek_YYMD = &LAST_WEEK_YYMD 


For the I8MDYY value I get 8302017, I'm looking to get 08302017. When I do this I8YYMD, I get 20170830. I must be missing something but can't figure out what it is! Any advice is appreciated!

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


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
Virtuoso
posted Hide Post
quote:

For the I8MDYY value I get 8302017


Format I8 is an Integer, a numeric value. Left side zero (0) are useless in numeric representation. So while the month will be below 10, you won't have it display as 08302017.


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
Virtuoso
posted Hide Post
If you need the 0 for display consistency, you can convert the Integer to an Alpha using this code:

 -SET &LAST_WEEK_MDYY=IF &LAST_WEEK_MDYY.LENGTH LE 7 THEN '0'||&LAST_WEEK_MDYY ELSE &LAST_WEEK_MDYY; 


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
-*
-SET &LAST_WEEK_I8MDYY = DATECVT((DATEADD((DATECVT (&YYMD, 'I8YYMD', 'YYMD')),'D', -07)), 'YYMD','I8MDYY');
-SET &LAST_WEEK_A8MDYY = DATECVT((DATEADD((DATECVT (&YYMD, 'I8YYMD', 'YYMD')),'D', -07)), 'YYMD','A8MDYY');
-*
-TYPE LAST_WEEK_I8MDYY -------- &LAST_WEEK_I8MDYY
-TYPE LAST_WEEK_A8MDYY -------- &LAST_WEEK_A8MDYY


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Silver Member
posted Hide Post
Thanks all of you! Based on the advice I just changed my format to an A8MDYY instead of I8MDYY and it now works as expected.


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
Master
posted Hide Post
cldiaz, here's why that worked. You have to remember that in Dialogue Manager, every variable is an alphanumeric string. However, when you specified a I8MDYY format, and since the variable was all numbers, DM treated it like a integer and trimmed the leading zero. Using A8MDYY left the leading zero. When I see issues on here about DM, a great deal of the time it is because the person asking the question doesn't know or has never been told that all local and global variables are alphanumeric strings.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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     [SOLVED] Dialogue Manager - Date to I8MDYY not working

Copyright © 1996-2020 Information Builders