Focal Point
[SOLVED] Convert SMRTDATE/M to A9 full month word?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6231027642

September 13, 2007, 05:07 PM
mgrackin
[SOLVED] Convert SMRTDATE/M to A9 full month word?
Is there a function on WF that will take a Smart Date formated field that is a format of "Mtr" and put the fullword of the month into an A9 alpha field?

Don't ask me why I wnat to do this because it would take too long to explain what I am doing. I am neck deep into a complicated but really cool report program.

Big Grin

This message has been edited. Last edited by: <Kathryn Henning>,


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
September 13, 2007, 05:19 PM
Francis Mariani
Wishful thinking!

I've found that we have to use DEFINE or COMPUTE. Here, I've typed it out for you, so you don't have to Big Grin

MTR/A9 = DECODE MX (
01 January  , 02 February, 03 March   , 04 April
05 May      , 06 June    , 07 July    , 08 August
09 September, 10 October , 11 November, 12 December ELSE '');



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
September 13, 2007, 05:23 PM
mgrackin
Thanks Francis for the thoughtfulness. However, I already coded the whole thing before I posted my question. I was just wondering if there was a simplier way. Apparently we need 1002 ways to work with dates in WF.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
September 13, 2007, 05:28 PM
Francis Mariani
Spoke too soon!

TABLE FILE GGORDER
SUM
ORDER_DATE NOPRINT
COMPUTE ORDER_DATEA/A8YYMD = ORDER_DATE;
COMPUTE ORDER_MTR/A17 = CHGDAT('YYMD','MX',ORDER_DATEA,'A17') ;
BY ORDER_DATE NOPRINT
WHERE READLIMIT EQ 10
END



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
September 13, 2007, 05:39 PM
Francis Mariani
Or

TABLE FILE GGORDER
SUM
ORDER_DATE NOPRINT
COMPUTE ORDER_DATEA/A8YYMD = ORDER_DATE;
COMPUTE ORDER_MTR/A9 = LCWORD(9, CHGDAT('YYMD','MX',ORDER_DATEA,'A9'), 'A9');
BY ORDER_DATE NOPRINT
WHERE READLIMIT EQ 10
END



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
September 13, 2007, 05:49 PM
Prarie
Very Good Winky


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
indeed!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Busy are you Francis? lol

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
Thanks Francis. I'll give that a try. It looks good. I will also look it up in the manual. Yikes! Eeker


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Here's just one more way.


TABLE FILE GGORDER
SUM
ORDER_DATE NOPRINT
COMPUTE ORDER_LOWER/MONtr = ORDER_DATE;
COMPUTE ORDER_UPPER/MONTR = ORDER_DATE;
BY ORDER_DATE NOPRINT
WHERE READLIMIT EQ 10
END


Glenda

In FOCUS Since 1990
Production 8.2 Windows
slick!
that's got uses for alot of stuff i am currently doing the old fashioned way...
thanks for reading the manual for us, Glenda. Wink




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
quote:
Originally posted by Francis Mariani:
-snip-
COMPUTE ORDER_MTR/A9 = LCWORD(9, CHGDAT('YYMD','MX',ORDER_DATEA,'A9'), 'A9');
[/code]


I always give CHGDAT a full 'A17' output to work with; when you give it A9, no telling what the additional A6 it returns may trounce.


- Jack Gross
WF through 8.1.05
My original requirement was for the Month Name to be in an ALPHA format field. Glenda's technique works great but does not put the month name into and alpha field.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
quote:
MONTR
Where's this curious format in the manual?

Tony, I have reports that take a half hour to run due to DBA's not having indexes on the DB2 tables, hence I have a lot of time...


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
COMPUTE CUR_MO/A17 = CHGDAT('YYMD', 'MDYYX', '&YYMD', 'A17');
COMPUTE DISP_MONTH/A9 = GETTOK(CUR_MO, 17, 1, ' ', 9, DISP_MONTH);


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
I just wanted to let everyone know I finally got a chance to change my code to use the CHGDAT function and it works great.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Whoa !!!

This is an old thread, but when did Mtr get changed to MONtr ?????

I've been struggling with this and thought it was a quirk of Windows 8 ....

Like Francis I have been using a DECODE as a workaround ...

MONtr actually works !


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP