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.
Don't know if this has already been reported here or not. There is a bug in release 7.7.03 when using the LAST attribute with date comparisons in DEFINEs and COMPUTEs. The following code will cause error (FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED.
DEFINE FILE GGSALES
NEWDATE/YYMD = DATE ;
DATE_BAD/I1 = IF (LAST NEWDATE EQ '') THEN 1 ELSE 0 ;
DATE_1996/I1 = IF (LAST NEWDATE FROM '19960101' TO '19961231') THEN 1 ELSE 0 ;
END
TABLE FILE GGSALES
PRINT NEWDATE
DATE_BAD
DATE_1996
WHERE RECORDLIMIT EQ 200 ;
END
Remove both LAST attributes from the above code and it works just fine.
The following code is a work-around for this problem:
DEFINE FILE GGSALES
NEWDATE/YYMD = DATE ;
NULL_DATE/YYMD = '';
BEG_DATE/YYMD = '19960101';
END_DATE/YYMD = '19961231';
DATE_BAD/I1 = IF (LAST NEWDATE EQ NULL_DATE) THEN 1 ELSE 0 ;
DATE_1996/I1 = IF (LAST NEWDATE FROM BEG_DATE TO END_DATE) THEN 1 ELSE 0 ;
END
TABLE FILE GGSALES
PRINT NEWDATE
DATE_BAD
DATE_1996
WHERE RECORDLIMIT EQ 200 ;
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
I don't think this is a bug, it is the way it is coded. Remember that internally a smart date is an integer and you are comparing NEWDATE to '', and '' is not an integer. In GGSALES, DATE does not have the MISSING attribute. This means that records will be 0, which is 12/31/1900, or be a regular date. You may be the victim of code tightening on IBI's part.
I have always coded this situation (boolean logic) like this:
DATE_BAD/I1=LAST NEWDATE EQ 0;
This message has been edited. Last edited by: jgelona,
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, 2006
As far as I can remember, code similar to that in my example has worked since SmartDates were introduced over ten years ago. Null/blank dates aside, code tightening would still not explain why the second date comparison between NEWDATE and the 1996 date literals fails (both with and without the single quotes), nor why both DEFINEs fail when LAST is used but run without error when LAST is removed.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
If you have not done so, like others have suggested, please contact Customer Support Services and open a case for assistance. The phone number is 1-800-736-6130, or access online at InfoResponse.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
Posts: 1948 | Location: New York | Registered: November 16, 2004
I never use LAST in defines, because it doesn't make sense to do so.
Sure it does:
DEFINE FILE CAR
EVERY_OTHER/I2 = IF COUNTRY NE LAST COUNTRY THEN
IMOD(EVERY_OTHER + 1,2,'I2') ELSE EVERY_OTHER;
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
EVERY_OTHER
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA,
BACKCOLOR='NONE',
$
TYPE=DATA,
BACKCOLOR=RGB(190 235 255),
WHEN=EVERY_OTHER EQ 1,
$
ENDSTYLE
END
Of course, the datasource must be pre-sorted for this to work. That can always be accomplished by doing a print-by to a hold file. . .
Rob
WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
Posts: 88 | Location: MI | Registered: July 23, 2009
I agree with Rob. I do this all the time especially when the data source is Oracle and Oracle has already sorted the data. Most of the time I can use TABLEF which prevents WebFOCUS from resorting the data. Depending on the size of the return set, this can be much faster.
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, 2006