Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Date in Title
Go
New
Search
Notify
Tools
Reply
  
[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, 2006Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2006Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2007Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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, 2006Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2006Reply With QuoteReport 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, 2009Reply With QuoteReport 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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport 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, 2009Reply With QuoteReport 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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Date in Title

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.