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] Month names - ought to be simple, right?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Month names - ought to be simple, right?
 Login/Join
 
Virtuoso
posted
Hello,

I'm trying to translate month numbers to month names, which I need to concatenate to another bit of text. For some reason I can't get it right and it just got to be something simple that I'm missing.

This bit works:
DEFINE FILE CAR
	DATE/I8YYMD = 20101101;
	MONTH/Mtr = DATE;
END
TABLE FILE CAR
PRINT MONTH
BY CAR
END


So, it prints a string with the month name. Good, just what I need! But...
I need to concatenate other text to the MONTH field, and WebFOCUS refuses to do that as it's apparently not a string field. What's the trick here?

In the end I want something like this:
DEFINE FILE CAR
	DATE/I8YYMD = 20101101;
	MONTH/Mtr = DATE;
END
TABLE FILE CAR
PRINT COMPUTE OPTION/A60 = '<option value="' || MONTH || '">' || MONTH || '</option>';
BY CAR
END


I get this error:
0 ERROR AT OR NEAR LINE 6 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
The /Mtr thing is just an edit-option for a date field. It does NOT change the format of the date field, it just displays it differently. Using it in another piece of calculation (which you're doing) will be done as a date-field, not as a string.
Take a look at the CHGDAT function, maybe that is what you're looking for.


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
GamP, right again. Just worked on something like this, so I'll share.

 DEFINE FILE CAR
 SOMEA6YYM /A6YYM = '201011';
 MONTH/A3  = LCWORD(3, CHGDAT('YYMD','MT',SOMEA6YYM,'A3') ,'A3') ;
END
TABLE FILE CAR
PRINT MONTH
BY CAR
END
 


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report This Post
Expert
posted Hide Post
If you want long month names then use -
MONTH/A10 = LCWORD(10, CHGDAT('YYMD','MX',SOMEA6YYM,'A10') ,'A10');


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Thanks guys, that did the trick.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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] Month names - ought to be simple, right?

Copyright © 1996-2020 Information Builders