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] Convert Date to Alpha Month and Year only (ex. May 2009)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert Date to Alpha Month and Year only (ex. May 2009)
 Login/Join
 
Member
posted
I have a report that has a footer that contains the previous month and year, but I need it to be in an alphanumeric month and year only.

I am able to get the previous month by doing the following:

-SET &Today_Date_YYMD = DATECVT(&YYMD,'I8YYMD','YYMD');
-SET &Begin_Month = DATEMOV(&Today_Date_YYMD,'BOM');
-SET &Last_End_Month = DATEADD(&Begin_Month, 'D', -1);
-SET &Last_End_Month_I8 = DATECVT(&Last_End_Month,'YYMD','I8YYMD');

But from this point on, I don't know how to make it look like September 2009.

My plan was to use it on the footer like this:
"Printed on <+0>&Last_Month_Year "

I have been searching Focal Point and couldn't find a similar situation.
I had been searching the "Almost 1001 Ways to Work With DATES in WebFOCUS" book but can't find the solution.

Thanks in advance for helping!

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


WF767, WinServ2003, SQLServ2000
HTML
 
Posts: 25 | Registered: March 17, 2009Report This Post
Guru
posted Hide Post
You can do something like this to your resulting date:
 
-SET &DT_ALPHA = DATECVT(&CPERIOD, 'I8YYMD', 'A6MDY');
-SET &DISPLAY_DT = CHGDAT('A6MDY','MDYYX',&DT_ALPHA, 'A17');


Using your &Last_End_Month_I8 instead of &CPERIOD.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Expert
posted Hide Post
As this is going to be in a footing, I would suggest useing a DEFINE field

DEFINE FILE CAR
Today/YYMD = &YYMD;
Last/MtrYY   = DATEADD(Today, 'M',-1);
END
TABLE FILE CAR
PRINT COUNTRY Today Last
FOOTING
"Month: <Last"
END


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
Member
posted Hide Post
Thanks N.Selph and Waz!!!

Somehow the -SET option keeps on returning a 19th century year. Here are the displays:

-SET &Today_Date_YYMD = DATECVT(20090531,'I8YYMD','YYMD');
-SET &Begin_Month = DATEMOV(39598,'BOM');
-SET &Last_End_Month = DATEADD(39568, 'D', -1);
-SET &Last_End_Month_I8 = DATECVT(39567,'YYMD', 'I8YYMD');
-SET &DT_ALPHA = DATECVT(20090430, 'I8YYMD', 'A6MDY');
-SET &DISPLAY_DT = CHGDAT('A6MDY','MDYYX',043009, 'A17');
-TYPE Today_Date_YYMD - 39598;
-TYPE Begin_Month - 39568;
-TYPE Last_End_Month - 39567;
-TYPE Last_End_Month_I8 - 20090430;
-TYPE DT_ALPHA - 043009;
-TYPE DISPLAY_DT - APRIL 30 1909 ;

Im sure it will work with just a few more changes.
I was able to remove the date but I could not fix the century.
It must had something to do with our y2k threshold settings.

I did the one in the DEFINE section and it worked fine.

Thanks again!
I think I will meet tomorrow's deadline for this report because of this!


WF767, WinServ2003, SQLServ2000
HTML
 
Posts: 25 | Registered: March 17, 2009Report This Post
Expert
posted Hide Post
If you have issues with 19th century, then use DEFCENT and YRTHRESH to set an active 100 year window.


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
Master
posted Hide Post
Try this:

-SET &RUNDATE=AYM(&YYMD/100,-1,'I6YYM');
-SET &RUNDATE=CHGDAT('I6YYM','MYYX',&RUNDATE, 'A17');
-TYPE &RUNDATE


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] Convert Date to Alpha Month and Year only (ex. May 2009)

Copyright © 1996-2020 Information Builders