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]Compute Last Month's date in Dialogue Manager

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Compute Last Month's date in Dialogue Manager
 Login/Join
 
Gold member
posted
Hi all,
I have searched this site for solutions in getting last month date in Dialogue Manager in month-yyyy (i.e. October-2011) format. I tried many of these solutions, but haven't been able to get them to work. Your input is greatly appreciated.


Seyed

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


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Gold member
posted Hide Post
Does this work for you?

-SET &LASTMONTH=AYM(EDIT(EDIT(&YYMD,'999999$$')),-1,'I6YYM');
-SET &LASTMONTH_DESC=CHGDAT('I8YYMD','MYYX',&LASTMONTH,'A17');


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Gold member
posted Hide Post
I just tried your solution, the result is blank.

Thank you,

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Virtuoso
posted Hide Post
Works for me! You evaluated the resulting value of &LASTMONTH_DESC and it was blank?

In my environment, &LASTMONTH_DESC was assigned a value of "OCTOBER 2011".



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
The result is blank? Is this because the code worked as expected?

Add
-TYPE &LASTMONTH_DESC
-TYPE &LASTMONTH
to see that it works.


Francis


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
quote:
-TYPE &LASTMONTH_DESC
-TYPE &LASTMONTH

The following code results
-SET &LASTMONTH=AYM(EDIT(EDIT(&YYMD,'999999$$')),-1,'I6YYM');
-SET &LASTMONTH_DESC=CHGDAT('I8YYMD','MYYX',&LASTMONTH,'A17');

-TYPE &LASTMONTH_DESC
-TYPE &LASTMONTH


in

0


It looked like the '&YYMD' does not have a value to process, but when I type &YYMD, I get '20111115' which is correct.

Thanks,


Seyed
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Virtuoso
posted Hide Post
Try this:

-SET &THIS_MONTH     = EDIT(&YYMD,'999999$$');
-SET &LAST_MONTH     = AYM(&THIS_MONTH,-1,'I6YYM');
-SET &LASTMONTH_DESC = CHGDAT('I8YYMD','MYYX',&LAST_MONTH,'A17');

-TYPE &LAST_MONTH
-TYPE &LASTMONTH_DESC


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Hi all,
Thank you very much for your inputs. Dan’s solution worked for me. There is one more tweak that I must do. I now how to figure out a way to convert the result from ‘OCTOBER 2011’ to ‘October-2011’ with a dash in between and month name being as Microsoft Word calls it “title case”d.

Thanks again to Dan and everyone who contributed.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Gold member
posted Hide Post
This gets it all:

 
-SET &DATE1 = CHGDAT('YYMD', 'MXYY', DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -1),'YYMD','A8YYMD'), 'A17');
-SET &DATE2 = EDIT(&DATE1,'9')|LOCASE(17,EDIT(&DATE1,'$9999999999999999'),'A17');
-SET &DATE3 = STRREP(&DATE2.LENGTH,&DATE2,2,' 2''',2,'-2''',&DATE2.LENGTH,'A&DATE2.LENGTH');

-TYPE &DATE1 &DATE2 &DATE3

 


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
 
Posts: 84 | Registered: December 13, 2005Report This Post
Gold member
posted Hide Post
Hi Microfich,
Thank you very much. Your solution worked nicely. Again, thanks everyone.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Virtuoso
posted Hide Post
Here's yet another way:

-SET &LASTMONTH      = DATECVT(DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'M',-1),'YYMD','A8YYMD'),'A8YYMD','MYY');
-SET &LASTMONTH_DESC = DATETRAN(&LASTMONTH, '(MYY)', '(tr-)', 'EN', 20, 'A20');
-TYPE &LASTMONTH_DESC



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
quote:
-SET &LASTMONTH = DATECVT(DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'M',-1),'YYMD','A8YYMD'),'A8YYMD','MYY');
-SET &LASTMONTH_DESC = DATETRAN(&LASTMONTH, '(MYY)', '(tr-)', 'EN', 20, 'A20');
-TYPE &LASTMONTH_DESC


Hi njsden,
I appreciate your input.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report 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]Compute Last Month's date in Dialogue Manager

Copyright © 1996-2020 Information Builders