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 use a couple of packed decimal fields formatted as P15.2 (VBR_PD_ELG_AMT) and P11.2 (VBR_GAIN_AMT) in the database in two DEFINE fields and define them as P15!d and P11!d because I want the whole dollar amount with the dollar sign. The code is below.
Most of the amounts are coming out fine. There are a few that are not rounding as they should. For example, 1852.12 comes out as $1853 oddly. There are only a few cases like this, but most of the amounts are rounding fine. Should I try to convert the packed decimal double precision fields in the database to something else before formatting them to a whole amount with the dollar sign..if anyone thinks?
DEFINE FILE pmr/pmr_prov_val_base_cluster
CLDR_DT/MDYY = DATECVT(ICURD_CLDR, 'I8YYMD', 'MDYY');
VBR_PD_ELG_AMT_P/P15!d = VBR_PD_ELG_AMT;
VBR_GAIN_AMT_P/P11!d = VBR_GAIN_AMT;
-*P_VBR_PD_ELG_AMT/P15!d = VBR_PD_ELG_AMT_P;
-*P_VBR_GAIN_AMT/P11!d = VBR_GAIN_AMT_P;
END
TABLE FILE pmr/pmr_prov_val_base_cluster
SUM VBR_PD_ELG_AMT
PMR_PROV_VAL_BASE_CLUSTER.PROV_VAL_BASE_PMT_FCT.VBR_PD_ELG_AMT_P AS 'Potential'
VBR_GAIN_AMT
PMR_PROV_VAL_BASE_CLUSTER.PROV_VAL_BASE_PMT_FCT.VBR_GAIN_AMT_P AS 'Actual'
-*BY PMR_PROV_VAL_BASE_CLUSTER.PROV_VAL_BASE_PMT_FCT.ICURD_CLDR
BY CLDR_DT AS 'Month
WHERE VBR_PRCG_PCT_VAL NE 0;
WHERE SPEC_CD EQ 'AC' OR 'PD' OR 'OB';
WHERE PRIM_LCTN_SW EQ 'Y'
WHERE PMR_PROV_VAL_BASE_CLUSTER.PROV_DMN.PROV_NPI EQ &NPI;
END
-RUN
-EXIT
This message has been edited. Last edited by: AMC2,
Since you reassign each single value from a DEFINE, each of them are rounded to then be added together by the SUM which may explain the "bad" rounding. Try with the following where it is rounded and formatted only at display
TABLE FILE pmr/pmr_prov_val_base_cluster
SUM PMR_PROV_VAL_BASE_CLUSTER.PROV_VAL_BASE_PMT_FCT.VBR_PD_ELG_AMT_P/P15!d AS 'Potential'
PMR_PROV_VAL_BASE_CLUSTER.PROV_VAL_BASE_PMT_FCT.VBR_GAIN_AMT_P/P15!d AS 'Actual'
BY CLDR_DT AS 'Month
WHERE VBR_PRCG_PCT_VAL NE 0;
WHERE SPEC_CD EQ 'AC' OR 'PD' OR 'OB';
WHERE PRIM_LCTN_SW EQ 'Y'
WHERE PMR_PROV_VAL_BASE_CLUSTER.PROV_DMN.PROV_NPI EQ &NPI;
END
-RUN
-EXIT
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
Thanks MartinY - By the way, I just rounded and formatted at the display and that did take care of those few instances were the rounding was off. Thanks for your suggestion also Danny-SRL.