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.
Our users would like for a field to show only if the policy number in greater than zero due to it would indicate it's ot a converted policy. If the policy number is greater than zero than it's a converted policy. Can a report be done to show a field off and on? And if so how would I go about coding it?This message has been edited. Last edited by: Kerry,
You can do a WHERE on the table and only extract Policy number greater than zero.
If there is a calculation, you may need to do a DEFINE and then a WHERE on the DEFINE field. (Note this may not be efficient depending on table size and calculation).
I know the where clause but they want the field itself to only show when a Policy has been converted. For instance say on 2/15/2010 the policy on the report was not converted then they don't want the field to appear at all on the report but then say 2/16/2010 the policy on the report was converted then they do want the field to show. At the moment I have a define to blank out the policy number if it equals a zero else show the policy number but thats not what they want because the field itself will still show up if the policy is blanked out. :-( Hope I'm making sense here.
Change POLICY_NUMB to 1111111 for the column to show...
SET NODATA = ' '
DEFINE FILE CAR
POLICY_NUMB/I7 = 0000000;
END
TABLE FILE CAR
PRINT
CAR
MODEL
RETAIL
POLICY_NUMB
BY COUNTRY
ON TABLE HOLD
END
-RUN
TABLE FILE HOLD
SUM
MAX.POLICY_NUMB
ON TABLE SAVE
END
-RUN
-READ SAVE, &POLICY
-SET &POLICY_COL = IF &POLICY GT 0 THEN 'POLICY_NUMB AS ' | '''' | 'Policy,Number' | '''' ELSE ' ';
TABLE FILE CAR
PRINT
CAR
MODEL
RETAIL
&POLICY_COL
BY COUNTRY
END
-RUN
-EXIT
SET NODATA = ' '
DEFINE FILE CAR
POLICY_NUMB/I7 = IF COUNTRY IN ('ENGLAND','JAPAN') THEN 1111111 ELSE 0000000;
END
TABLE FILE CAR
PRINT
CAR
MODEL
RETAIL
POLICY_NUMB
BY COUNTRY
ON TABLE HOLD
END
-RUN
TABLE FILE HOLD
SUM
MAX.POLICY_NUMB
BY COUNTRY
ON TABLE SAVE
END
-RUN
-SET &XLINES = &LINES;
-SET &CNTR = 0;
-REPEAT DO_REPORT &XLINES TIMES
-SET &CNTR = &CNTR + 1;
-SET &OPEN_CLOSE = IF &CNTR EQ 1 THEN 'OPEN'
- ELSE IF &CNTR EQ &XLINES THEN 'CLOSE' ELSE ' ';
-READ SAVE NOCLOSE &COUNTRY.A10. &POLICY.I7.
-SET &POLICY_COL = IF &POLICY GT 0 THEN 'POLICY_NUMB AS ' | '''' | 'Policy,Number' | '''' ELSE ' ';
TABLE FILE CAR
PRINT
CAR
MODEL
RETAIL
&POLICY_COL
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY';
ON TABLE PCHOLD FORMAT EXL2K &OPEN_CLOSE
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
TITLETEXT='&COUNTRY',
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
END
-RUN
-DO_REPORT
-EXIT
Tom I was able to get your first code to work for me but I have one more question for you. On some days there will be no policies which will give the report an error message due to not data to supply the &POLICY pramatar how do I go about not getting an error when there are no policies at all? Or is that there your 2nd code comes in?
Here's a different approach using the StyleSheet, an external style declaration, and HTMLFORM to hide the column when the policy number is zero.
DEFINE FILE CAR
POLICY_NO/I6 = IF COUNTRY EQ 'ITALY' OR 'FRANCE' THEN 0 ELSE (BYTVAL(COUNTRY,'I3') * 10000 + BYTVAL(CAR,'I3') * 100 + BYTVAL(MODEL,'I3'));
END
-*
TABLE FILE CAR
SUM MAX.POLICY_NO
BY COUNTRY PAGE-BREAK
BY CAR
BY MODEL
ON TABLE SET HTMLCSS ON
ON TABLE HOLD FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=MAX.POLICY_NO, CLASS=nodisplay, WHEN=MAX.POLICY_NO EQ 0, $
ENDSTYLE
END
-*
-RUN
-HTMLFORM BEGIN
<style type="text/css">
.nodisplay {display: none;}
</style>
!IBI.FIL.HOLD;
-HTMLFORM END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
SET NODATA = ' '
DEFINE FILE PCHGPDANB1
TOPS_POL_NBR/A7=EDIT(CONV_POL_NUM, '$999999');
TOPS_NBR/A7=IF TOPS_POL_NBR EQ '000000' THEN '0' ELSE TOPS_POL_NBR;
END
TABLE FILE PCHGPDANB1
PRINT
TOPS_NBR
WHERE ACTIVITY_DESCR EQ 'Added Payroll Deduct';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE HOLD
ON TABLE SET HTMLCSS ON
END
-RUN
TABLE FILE HOLD
SUM
MAX.TOPS_NBR
ON TABLE SAVE
END
-RUN
-READ SAVE, &POLICY
-SET &POLICY_COL = IF &POLICY GE 000001 THEN 'TOPS_NBR AS ' | '''' | 'Policy,Number' | '''' ELSE ' ';
TABLE FILE PCHGPDANB1
PRINT
MEM_NBR AS 'Member #'
POLICY_NBR AS 'Policy #'
TOPS_NBR AS 'Legacy Policy #'
&POLICY_COL
BILL_ACCOUNT_NBR AS 'Bill Acct #'
BILL_ACC_POL_STA AS 'Bill Acct,Status'
ACTIVITY_DESCR AS 'Activity Description'
NEXT_PMT_DUE_DT AS 'Premium Due,Date'
TERM_EXP_DATE AS 'Term Exp ,Date'
PAY_OFF_AMT AS 'Pay Off ,Amt Due'
PAYROLL_NUMBER AS 'Payroll Num'
RUN_DATE AS 'Activity Date'
REFUND_AMT AS 'Refund Amt'
BY BILL_ACCOUNT_NBR NOPRINT
BY POL_TYP_CD AS 'Policy Type'
BY Name_first_last AS 'Insured Name'
ON TABLE SUBHEAD
"Payroll Deduction Added"
" Run Date: <+0>&DATE_EXTRACT<+0> "
" "
WHERE ACTIVITY_DESCR EQ 'Added Payroll Deduct';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END
-EXIT
It works great when there is a policy on the report the heading shows up only when needed but on days the report is empty it gives an error. 0 ERROR AT OR NEAR LINE 131 IN PROCEDURE paychgpdanb_rclib1 (FOC295) A VALUE IS MISSING FOR: &POLICY
..I tried you code but the field still shows up. :-( or should I say the heading on the field.
Tom,
The column appears only because some records do have policy numbers. If you add a WHERE clause to select only those records with POLICY_NO = 0, you will see that there is no evidence of the column - not even the column title.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
I'm probably making a mountain out of a molehill, but, here goes. I broke the reporting up by 0 policies and policies GT 0:
-DEFAULT &POLICY_COL = ''
DEFINE FILE PCHGPDANB1
MAIN_SORT/I1 = IF EDIT(CONV_POL_NUM, '$999999') EQ '000000' THEN 1 ELSE 2;
END
TABLE FILE PCHGPDANB1
COUNT ENTRIES
BY MAIN_SORT
WHERE ACTIVITY_DESCR EQ 'Added Payroll Deduct';
ON TABLE SAVE
END
-RUN
-SET &XLINES = &LINES;
-SET &CNTR = 1;
-*********************************************************
-IF &XLINES GT 1 GOTO DO_RPT_LOOP;
-READ SAVE &SORT_KEY.I1.
-SET &POLICY_COL = IF &SORT_KEY EQ 2 THEN 'TOPS_NBR AS ' | '''' | 'Policy,Number' | '''' ELSE ' ';
-SET &CNTR = &SORT_KEY;
-GOTO SKIP_LOOP
-*********************************************************
-DO_RPT_LOOP
-REPEAT DO_REPORT 2 TIMES
-SET &POLICY_COL = IF &CNTR GT 1 THEN 'TOPS_NBR AS ' | '''' | 'Policy,Number' | '''' ELSE ' ';
-*********************************************************
-SKIP_LOOP
TABLE FILE PCHGPDANB1
PRINT
MEM_NBR AS 'Member #'
POLICY_NBR AS 'Policy #'
TOPS_NBR AS 'Legacy Policy #'
&POLICY_COL
BILL_ACCOUNT_NBR AS 'Bill Acct #'
BILL_ACC_POL_STA AS 'Bill Acct,Status'
ACTIVITY_DESCR AS 'Activity Description'
NEXT_PMT_DUE_DT AS 'Premium Due,Date'
TERM_EXP_DATE AS 'Term Exp ,Date'
PAY_OFF_AMT AS 'Pay Off ,Amt Due'
PAYROLL_NUMBER AS 'Payroll Num'
RUN_DATE AS 'Activity Date'
REFUND_AMT AS 'Refund Amt'
MAIN_SORT NOPRINT
BY BILL_ACCOUNT_NBR NOPRINT
BY POL_TYP_CD AS 'Policy Type'
BY Name_first_last AS 'Insured Name'
WHERE MAIN_SORT EQ &CNTR;
ON TABLE SUBHEAD
"Payroll Deduction Added"
" Run Date: <+0>&DATE_EXTRACT<+0> "
" "
WHERE ACTIVITY_DESCR EQ 'Added Payroll Deduct';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END
-RUN
-IF &XLINES EQ 1 GOTO EOJ;
-IF &CNTR GT 2 GOTO EOJ;
-SET &CNTR = &CNTR + 1;
-DO_REPORT
-EOJ
-EXIT
hth
Atturhari, Is there any way to change the period "ON TABLE SET EMPTYREPORT ANSI" creates into a zero?
You can achieve that by an extra variable. Not sure if this is what you really wanted.
TABLE FILE HOLD SUM MAX.TOPS_NBR ON TABLE SET EMPTYREPORT ANSI ON TABLE SAVE END -RUN -READ SAVE, &POLICY_1 -SET &POLICY = IF &POLICY_1 EQ ' ' THEN 00000 ELSE &POLICY;
WF 7.7.02 on Windows 7 Teradata HTML,PDF,EXCEL,AHTML
I should be back on this by this afternoon. If anyone has other thoughts please let me know. Thank you to all that have been helping. Hope everyone had a great weekend!