Focal Point
Extracting a Month name from a numeric month value?

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

September 04, 2007, 11:36 AM
Jason K.
Extracting a Month name from a numeric month value?
I'm having a little trouble finding any documentation on displaying a month's name from a numeric value of 200708.

Is there a way to gather this information?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 04, 2007, 11:47 AM
Leah
As the numeric field doesn't have a 'day' in it, I'd suggest using edit to extract the two digit month and then set up a decode.

Assume it is a numeric 6

monthn/a2 = edit (numeric field,'$$$$99');
monthsp/a12 = decode monthn ( '01' January
'02' February ..... else 'error';


Leah
September 04, 2007, 01:14 PM
ET
Try this.
DEFINE FILE CAR
DATE/I6YYMT WITH COUNTRY=200708;
END
TABLEF FILE CAR
PRINT COUNTRY DATE
END

gives the following results.

COUNTRY DATE
------- ----
ENGLAND 2007 AUG
FRANCE 2007 AUG
ITALY 2007 AUG
JAPAN 2007 AUG
W GERMANY 2007 AUG


FOCUS 7.6 MVS PDF,HTML,EXCEL
September 04, 2007, 01:22 PM
Leah
I learn new every day, what form gives the month in say spelled out completely.


Leah
September 04, 2007, 01:30 PM
Jason K.
Great Tips!
It's working well now!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 04, 2007, 01:36 PM
ET
This gives the full month but only works with smart dates.

DEFINE FILE CAR
DATE/YYMTR WITH COUNTRY='200708';
END
TABLEF FILE CAR
PRINT COUNTRY DATE DATE/YYMtr
END
COUNTRY DATE DATE
------- ---- ----
ENGLAND 2007, AUGUST 2007, August
FRANCE 2007, AUGUST 2007, August
ITALY 2007, AUGUST 2007, August
JAPAN 2007, AUGUST 2007, August
W GERMANY 2007, AUGUST 2007, August


FOCUS 7.6 MVS PDF,HTML,EXCEL