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.
I am trying to create a virtual field with DEFINE that uses the selection of a parameter in its logic. When a value like 'CANCELED' is selected it works great, but when "ALL" (foc_null) is selected the DEFINE field seems to not get created.
I've tried variations of the logic with and without quotes around the parameter but nothing seems to work properly for both selected values and "ALL" cases.
DEFINE FILE CLUBMEMBERS
BypassDate/MDYY=
IF ( &CLUBSWITCHTYPEFILTER EQ '_FOC_NULL' ) THEN '01/01/1920' ELSE
IF ( &CLUBSWITCHTYPEFILTER EQ 'CANCELED' ) THEN '&CLUBMEMBERDATEFROM' ELSE '01/01/1920';
END
TABLE FILE CLUBMEMBERS
PRINT
BypassDate
0 ERROR AT OR NEAR LINE 95 IN PROCEDURE club_member_movement_report_fex_v1FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: _FOC_NULL 0 ERROR AT OR NEAR LINE 120 IN PROCEDURE club_member_movement_report_fex_v1 (FOC003) THE FIELDNAME IS NOT RECOGNIZED: BypassDate BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Any ideas?This message has been edited. Last edited by: Kerry,
Try determining the Bypass Date in Dialogue Manager, then use it in the DEFINE. The FOCNULL is active in the DEFINE (preventing the line of code from being parsed) but will not be in Dialogue Manager.
-SET &BYPASSDATE =
- IF ( &CLUBSWITCHTYPEFILTER EQ '_FOC_NULL' ) THEN '01/01/1920' ELSE
- IF ( &CLUBSWITCHTYPEFILTER EQ 'CANCELED' ) THEN &CLUBMEMBERDATEFROM ELSE '01/01/1920';
DEFINE FILE CLUBMEMBERS
BypassDate/MDYY = &BYPASSDATE;
END
By the way, you may need to use the WITH attribute for the defined field...
DEFINE FILE CLUBMEMBERS
BypassDate/MDYY WITH real-field = &BYPASSDATE;
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
Also, a DEFINE is wrong if you "need to use this in a WHERE clause". The WHERE clause should use the Dialogue Manager variable. Try
WHERE TEST_DATE GT '&BYPASSDATE';
Of course, the code may not simply be something like this, because, depending on the data source, you may need to use a function, like this:
WHERE DUEDATE FROM DT(&DTTM_FROM) TO DT(&DTTM_TO);
, or convert the / to - or make the date an integer or
I wouldn't create a constant DEFINE field that will only be used in a WHERE clause. With DEFINE, you're creating the field for every row in the input table, which may be inefficient.
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
Thanks again, and just to close the loop, here's the final (edited) version of what worked. Essentially this 'hack' allowed the report to bypass a "From Date" parameter on specific filter selections.
...
SET ALL = PASS
-SET &BYPASSDATE =
- IF ( &CLUBSWITCHTYPEFILTER EQ '_FOC_NULL' ) THEN '01/01/1900' ELSE
- IF ( &CLUBSWITCHTYPEFILTER EQ '''ON HOLD''' ) THEN '01/01/1900' ELSE &CLUBMEMBERDATEFROM;
DEFINE FILE CLUBMEMBERS
BypassDate/MDYY = '&BYPASSDATE';
END
TABLE FILE CLUBMEMBERS
PRINT
...
WHERE CLUBMEMBERS.CLUBMEMBERS.DATEADDED GE '&BYPASSDATE';
...
Well since you're dealing with DM and DM-parameters. You should DM handle it. Not Focus.
-IF &CLUBSWITCHTYPEFILTER EQ _FOC_NULL THEN L_FOCNULL ELSE CONTINUE;
-IF '&CLUBSWITCHTYPEFILTER' EQ 'CANCELED' THEN L_CANCELED ELSE CONTINUE;
-*
-* Do your define here for default situation.
-*
-GOTO L_END
-L_FOCNULL
-*
-* Do your define here for '_FOC_NULL' situation.
-*
-GOTO L_END
-L_CANCELED
-*
-* Do your define here for 'CANCELED' situation.
-*
-GOTO L_END
-L_END
G'luck
_____________________ WF: 8.0.0.9 > going 8.2.0.5
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010