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] Date in Title

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date in Title
 Login/Join
 
Platinum Member
posted
Is this possible? I cannot get the NEWDATE12 to be the actual TITLE.

DEFINE FILE ACTFORMS
CURDATE/YYMD=&YYMD;
NEWDATE12/YYM=DATEADD(CURDATE,'M',-12);
END

TABLE FILE ACTFORMS
PRINT
ORDERS_MINUS12 AS 'BY FORM#
END

Thanks

WEBFOCUS 7.6.8

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


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11
 
Posts: 125 | Location: Columbus, Ohio | Registered: March 31, 2006Report This Post
Expert
posted Hide Post
To get the value of NEWDATE12 to be in the title, you will need to have an extra step to save the value, and -READ it into a &var.

e.g.
TABLE FILE ACTFORMS
SUM MAX.NEWDATE12
ON TABLE SAVE AS MY_DATE
END
-RUN
-READ MY_DATE &DateVar.A6.


Then use the variable in the title.
ORDERS_MINUS12 AS '&DateVar BY FORM#'

Also when you post code, use the
[CODE] 
[/code] tag, so the post does not get screwed up.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Virtuoso
posted Hide Post
Hi neuro, if your date is entirely dependent on your system's current date you may also try calculating NEWDATE12 as follows:

-SET &NEWDATE12 = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12), 'YYMD', 'A8YYMD');

TABLE FILE ACTFORMS
PRINT
ORDERS_MINUS12 AS '&NEWDATE12'
BY FORM#
END


What both Waz's suggestion and this one tell you is that you cannot embed a data field value inside of a TITLE the same way you do it in a HEADING, SUBHEAD, etc. The way to do it is by using dialog manager &variables which can be either data-driven (Waz's approach) or, in simple cases, environment-based. Just pick the one that makes the most sense to your case.



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
Platinum Member
posted Hide Post
Okay, I think have it. Except I am trying to get a friendly format and have the following which is not working:


-SET &NEWDATE12 = CHGDAT('I8YYMD', 'MXYY',DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','I8YYMD'), 'A17');


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11
 
Posts: 125 | Location: Columbus, Ohio | Registered: March 31, 2006Report This Post
Expert
posted Hide Post
Try in two steps:

-SET &DT1A = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','A8YYMD');
-SET &NEWDATE12 = CHGDAT('YYMD', 'MXYY', &DT1A, 'A17');

-TYPE &DT1A
-TYPE &NEWDATE12


DATECVT and DATEADD are "Standard Date and Time Functions", while CHGDAT is a "Legacy Date Function".

Others may post slightly different methods...


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
Virtuoso
posted Hide Post
quote:
-SET &NEWDATE12 = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12), 'YYMD', 'A8YYMD');


neuro, by leaving the expression exactly as I provided you with originally it should be easy to wrap it with CHGDAT to obtain the value you expect:

-SET &NEWDATE12 = CHGDAT('YYMD', 'MXYY', DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','A8YYMD'), 'A17');


Gives you:
FEBRUARY 2009


The key there is to use A8YYMD as the output format in the outer DATECVT function and YYMD as the input format to CHGDAT.

Regards,
- Neftali.



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
Virtuoso
posted Hide Post
Another alternative:

-SET &CURMTH = EDIT(&DATEYYM,'9999$99');
-SET &NEWDATE = AYM(&CURMTH,-12,'I6');
-SET &OUTDATE = CHGDAT('YYM','MXYY',&NEWDATE,'A17');

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
There are a host of Date variables, one of them may help.
-TYPE &|DATE           : &DATE
-TYPE &|DATED          : &DATED
-TYPE &|DATEDMtrYY     : &DATEDMtrYY
-TYPE &|DATEDMY        : &DATEDMY
-TYPE &|DATEDMYY       : &DATEDMYY
-TYPE &|DATEDwMtrYY    : &DATEDwMtrYY
-TYPE &|DATEJ          : &DATEJ
-TYPE &|DATEJUL        : &DATEJUL
-TYPE &|DATEM          : &DATEM
-TYPE &|DATEMDwtYY     : &DATEMDwtYY
-TYPE &|DATEMDWtrY     : &DATEMDWtrY
-TYPE &|DATEMDY        : &DATEMDY
-TYPE &|DATEMDYY       : &DATEMDYY
-TYPE &|DATEMt         : &DATEMt
-TYPE &|DATEMT         : &DATEMT
-TYPE &|DATEMtDwY      : &DATEMtDwY
-TYPE &|DATEMtrDYY     : &DATEMtrDYY
-TYPE &|DATEMtrDwtYY   : &DATEMtrDwtYY
-TYPE &|DATEMTDWTRYY   : &DATEMTDWTRYY
-TYPE &|DATEMtr        : &DATEMtr
-TYPE &|DATEMTr        : &DATEMTr
-TYPE &|DATEMTR        : &DATEMTR
-TYPE &|DATEMTRDwY     : &DATEMTRDwY
-TYPE &|DATEMTRDY      : &DATEMTRDY
-TYPE &|DATEMTY        : &DATEMTY
-TYPE &|DATEMTrYY      : &DATEMTrYY
-TYPE &|DATEMY         : &DATEMY
-TYPE &|DATEMYY        : &DATEMYY
-TYPE &|DATEQ          : &DATEQ
-TYPE &|DATEQY         : &DATEQY
-TYPE &|DATEQYY        : &DATEQYY
-TYPE &|DATEW          : &DATEW
-TYPE &|DATEwJ         : &DATEwJ
-TYPE &|DATEWJ         : &DATEWJ
-TYPE &|DATEWt         : &DATEWt
-TYPE &|DATEWT         : &DATEWT
-TYPE &|DATEWtr        : &DATEWtr
-TYPE &|DATEWTr        : &DATEWTr
-TYPE &|DATEWTR        : &DATEWTR
-TYPE &|DATEY          : &DATEY
-TYPE &|DATEYBMBD      : &DATEYBMBD
-TYPE &|DATEYM         : &DATEYM
-TYPE &|DATEYMDWT      : &DATEYMDWT
-TYPE &|DATEYQ         : &DATEYQ
-TYPE &|DATEYY         : &DATEYY
-TYPE &|DATEYYQ        : &DATEYYQ
-TYPE &|DATEYMD        : &DATEYMD
-TYPE &|DATEYYJ        : &DATEYYJ
-TYPE &|DATEYYJUL      : &DATEYYJUL
-TYPE &|DATEYYM        : &DATEYYM
-TYPE &|DATEYYMD       : &DATEYYMD
-TYPE &|DATEYYMDW      : &DATEYYMDW
-TYPE &|DATEYYMtrD     : &DATEYYMtrD
-TYPE &|DATEYYMtrDW    : &DATEYYMtrDW


For example:
&DATEMTrYY gives you FEBRUARY, 2010


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Platinum Member
posted Hide Post
Thank you that worked!


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11
 
Posts: 125 | Location: Columbus, Ohio | Registered: March 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
There are a host of Date variables, one of them may help


Waz, that list of variables is great and useful. I'll make sure I'll bookmark it for future reference!

Thanks,
Neftali.



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
Virtuoso
posted Hide Post
yes for me too....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
Waz, which one of these formats will return this exact format: Sep-10


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
 
Posts: 106 | Registered: June 25, 2009Report This Post
Virtuoso
posted Hide Post
That date representation is a custom one, easily created out of one of the standards:
-SET &MYDATE = EDIT(&DATEMtDwY,'999$-$$$99');
-TYPE &MYDATE


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
Thanks GamP. works great. Looks like I'm going to have to cough up the 25 bucks and buy that date format book.


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
 
Posts: 106 | Registered: June 25, 2009Report This Post
Virtuoso
posted Hide Post
As Frank already said, that book costs only 25 $ is is worth every one of them.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report 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] Date in Title

Copyright © 1996-2020 Information Builders