Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] (FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] (FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR
 Login/Join
 
Member
posted
Hi,
I am trying to get some code to work and I'm stuck here
When I execute the second SET command the values all appear to be there but when I TYPE it out after the SET I get the ******** is there anyway to fix this?

-*****--V_MASTER_CASH_ADJ
-TYPE 104038080.74
104038080.74
-SET &V_ASSETS_MASTER_CASH=TRUNCATE( 104038080.74);
-SET &V_MASTER_CASH_ADJ=IF 'EXECUTED' EQ 'ORDERED' THEN (( 104038080.74) - 0 - 0) ELSE IF 'EXECUTED' EQ 'EXECUTED' THEN (( 104038080.74) - 0) ELSE ( 104038080.74);
-SET &V_MASTER_CASH_ADJ=TRUNCATE(********);
-TYPE ********
********
-SET &V_HOL_MASTER_ASSET_TYPE1=UPCASE(15,'AS ACCOUNTED','A15');
-SET &V_HOL_MASTER_ASSET_TYPE1=TRUNCATE(AS ACCOUNTED );
-******--V_MASTER_TNA
-SET &V_MASTER_TNA= IF 'AS ACCOUNTED' EQ 'CALCULATED' THEN ( 2757428823.60 + ******** - 0) ELSE IF 'AS ACCOUNTED' EQ 'OTHER' THEN As-Accounted ELSE 2860464543.06;
(FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR

This message has been edited. Last edited by: Kerry,


PROD: WF 7.6.4/Solaris
NON-PROD: WF 7.6.11/Solaris
 
Posts: 4 | Location: Boston,MA | Registered: July 24, 2007Report This Post
Virtuoso
posted Hide Post
Can you post the actual code being used instead of the execution output?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
We need to see which variables are being used and how, but apparently you're getting a data precision error based on the ******* results being displayed.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
This is probably not exactly what you need but give it a try and see if it gives you some ideas:

-SET &V_MASTER_CASH_ADJ= PTOA(104038080.74 - 0 -0, '(P20.2)', 'A20');
-SET &V_MASTER_CASH_ADJ_T= PTOA(&V_MASTER_CASH_ADJ, '(P20)', 'A20');
-TYPE &V_MASTER_CASH_ADJ
-TYPE &V_MASTER_CASH_ADJ_T


I'm basically converting everything to strings since DM does not seem to be able to keep "big" numbers in &variables. It can deal properly with them in internal calculations though.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
-SET &V_MASTER_CASH_ADJ_T= PTOA(&V_MASTER_CASH_ADJ, '(P20)', 'A20');


Keep in mind that this is not technically truncating the number but rounding it instead!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
I poked around with this as well. By default DM uses integers with a maximum size of 11 digits. Use DMPRECISION to set decimal precision:

SET DMPRECISION = 2


I just can't get DM to work with the 104038080.74 number. I thought we could convert the value to numeric using a format conversion function, but I can't get this to work.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Here is the actual code....

-*****--V_MASTER_CASH_ADJ
-TYPE &V_ASSETS_MASTER_CASH
-SET &V_ASSETS_MASTER_CASH=TRUNCATE(&V_ASSETS_MASTER_CASH);
-SET &V_MASTER_CASH_ADJ=IF &P_MSTR_HLDNGS_TYPE1.QUOTEDSTRING EQ 'ORDERED' THEN ((&V_ASSETS_MASTER_CASH) - &V_EXORD_MASTER_ORDERED_MKT_VAL - &V_EXORD_MASTER_EXEC_MKT_VAL) ELSE IF &P_MSTR_HLDNGS_TYPE1.QUOTEDSTRING EQ 'EXECUTED' THEN ((&V_ASSETS_MASTER_CASH) - &V_EXORD_MASTER_EXEC_MKT_VAL) ELSE (&V_ASSETS_MASTER_CASH);
-SET &V_MASTER_CASH_ADJ=TRUNCATE(&V_MASTER_CASH_ADJ);
-*SET &V_MASTER_CASH_ADJ=115542157.55;
-TYPE &V_MASTER_CASH_ADJ
-SET &V_HOL_MASTER_ASSET_TYPE1=UPCASE(15,&V_HOL_MASTER_ASSET_TYPE.QUOTEDSTRING,'A15');
-SET &V_HOL_MASTER_ASSET_TYPE1=TRUNCATE(&V_HOL_MASTER_ASSET_TYPE1);
-******--V_MASTER_TNA
-SET &V_MASTER_TNA= IF &V_HOL_MASTER_ASSET_TYPE1.QUOTEDSTRING EQ 'CALCULATED' THEN (&V_MSTR_MKT_VAL_SUM + &V_MASTER_CASH_ADJ - &V_EXORD_MASTER_FUTURES_EXPOSUR) ELSE IF &V_HOL_MASTER_ASSET_TYPE1.QUOTEDSTRING EQ 'OTHER' THEN &P_D_MSTR_ASSET_TYPE ELSE &V_ASSETS_MASTER_ASSETS_TNA_ADJ;
-TYPE &V_MASTER_TNA


PROD: WF 7.6.4/Solaris
NON-PROD: WF 7.6.11/Solaris
 
Posts: 4 | Location: Boston,MA | Registered: July 24, 2007Report This Post
Expert
posted Hide Post
Sometimes it's easier working with WebFOCUS code than with Dialogue Manager, particularly with numbers:

-SET &ECHO=ALL;

SET HOLDLIST=PRINTONLY
-RUN

-DEFAULT &V_ASSETS_MASTER_CASH = 104038080.74;
-DEFAULT &V_EXORD_MASTER_ORDERED_MKT_VAL = 1;
-DEFAULT &V_EXORD_MASTER_EXEC_MKT_VAL = 1;
-DEFAULT &V_MASTER_CASH_ADJ = 3.4;
-DEFAULT &V_EXORD_MASTER_FUTURES_EXPOSUR = 76.7;
-DEFAULT &P_D_MSTR_ASSET_TYPE = 666123.23;
-DEFAULT &V_MSTR_MKT_VAL_SUM = 500.19;
-DEFAULT &V_ASSETS_MASTER_ASSETS_TNA_ADJ = 101.94;
-DEFAULT &P_MSTR_HLDNGS_TYPE = 'Ordered';
-DEFAULT &V_HOL_MASTER_ASSET_TYPE = 'Calculated';

-SET &P_MSTR_HLDNGS_TYPE = UPCASE(15,&P_MSTR_HLDNGS_TYPE,'A15');
-SET &V_HOL_MASTER_ASSET_TYPE = UPCASE(15,&V_HOL_MASTER_ASSET_TYPE,'A15');

DEFINE FILE CAR
V_MASTER_CASH_ADJ/D20.2 =
  IF '&P_MSTR_HLDNGS_TYPE' EQ 'ORDERED'
  THEN ((&V_ASSETS_MASTER_CASH) - &V_EXORD_MASTER_ORDERED_MKT_VAL - &V_EXORD_MASTER_EXEC_MKT_VAL) ELSE
  IF '&P_MSTR_HLDNGS_TYPE' EQ 'EXECUTED'
  THEN ((&V_ASSETS_MASTER_CASH) - &V_EXORD_MASTER_EXEC_MKT_VAL) ELSE (&V_ASSETS_MASTER_CASH);

V_MASTER_TNA/D20.2 =
  IF '&V_HOL_MASTER_ASSET_TYPE' EQ 'CALCULATED'
  THEN (&V_MSTR_MKT_VAL_SUM + &V_MASTER_CASH_ADJ - &V_EXORD_MASTER_FUTURES_EXPOSUR) ELSE
  IF '&V_HOL_MASTER_ASSET_TYPE' EQ 'OTHER'
  THEN &P_D_MSTR_ASSET_TYPE ELSE &V_ASSETS_MASTER_ASSETS_TNA_ADJ;
END

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
V_MASTER_CASH_ADJ
V_MASTER_TNA
ON TABLE SAVE AS S001
WHERE RECORDLIMIT EQ 1
END
-RUN
-READ S001 &V_MASTER_CASH_ADJ.A20. &V_MASTER_TNA.A20

-TYPE &V_MASTER_CASH_ADJ &V_MASTER_TNA


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Your number 104038080.74 seems to be one digit too big for DM to handle in calculations. If you don't expect to deal with numbers that large then your code should work as is. Otherwise, you may be able to use function FTOA (similar to PTOA suggested by njsden) to avoid this limitation, or you could probably create a DEFINE FUNCTION to handle to calculations. Here's an excellent example of a DEFINE FUNCTION used in DM, posted by Francis:

DEFINE FUNCTION example


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] (FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR

Copyright © 1996-2020 Information Builders