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.
Originally posted by Kapil Shinde: Hi guys i am trying to run the following code but says Error: FOC282 RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD,
DEFINE FILE USER_HOLD
-*TEST/I11 = IF LOGINS EQ 0 THEN 0 ELSE 1;
D_DATE/DMY = HDATE(CERTIFICATIONDATE, 'YYMD');
I_MONTH/I2 = DPART(D_DATE, 'MM', 'I11');
S_MONTH/M = I_MONTH;
A_MONTH/A4 = EDIT(I_MONTH); -* the error is at -*this line.
I_YEAR/I4 = DPART(D_DATE, 'YEAR', 'I11');
S_YEAR/YY = I_YEAR;
A_YEAR/A4 = EDIT(I_YEAR);
A_YEAR_MONTH/A8 = A_YEAR|A_MONTH;
END
First off, put your code between
[code]
[/code] tags.
Don't return an 'I11' if you're only going to use 2 or 4 decimals anyway. Better yet, return the value into the virtual field you're defining, that takes care of the field size automatically (I still think it's silly that FOCUS doesn't do that for us). That's probably why FOCUS thinks that I_MONTH won't fit in an A4 field; remember that that /I2 only specifies the display format, internally you made that field an I11.
And why are you using DPART instead of HPART? You don't need that D_DATE field at all.
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 :
Bearing in mind that your sample only appears to have some defines that are used to build a single result - A_YEAR_MONTH (with the exception of S_MONTH and S_YEAR).
What I meant by overdoing it is, that in your sample, you convert CERTIFICATIONDATE into D_DATE and then convert that into I_MONTH and I_YEAR. You further convert I_MONTH into A_MONTH and I_YEAR into A_YEAR before combining both of those fields into A_YEAR_MONTH which is probably an extra 20 bytes per row of data pulled into the internal matrix in excess of the actual 8 bytes that is the ultimate result.
If you multiply those 20 bytes by the number of rows returned from your request then your internal matrix is bigger than what it needs to be.
Hopefully you understand what I meant?
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, 2004
Then you'll see, that it is not the internal spoon that bends, it is only yourself.
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 :