Focal Point
[SOLVED] how do i caluclate with amper variables with large values?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1427094276

September 03, 2014, 07:48 AM
TKMAN
[SOLVED] how do i caluclate with amper variables with large values?
Need to calulate with a (10 dig) 6.000.569.885 number.

-SET &REPEadfTMEAMT = 100 + 1;
This gives me the correct result 101.

-SET &REPEadfTMEAMT = 6000569885 + 1;
This gives me some asterix(****).
SET COUNTWIDTH = ON does not seem to apply to amper variables..

Must be quite simple... but ... no clue ..atm.

thanks in advance for any idea.
Marcus

This message has been edited. Last edited by: <Kathryn Henning>,


-----------------------------
PROD WF 7.7.02, PMF 5.2.3, MSQL 2005
QA WF 7.7.02, PMF 5.2.3, MSQL 2005
Primarily self-service; adapters: SAP BW, SAP R/3, SQL Server, FlexEnable
Windows, all output
September 03, 2014, 08:37 AM
MartinY
Try this :

-SET &REPEadfTMEAMT = 6000569885;

DEFINE FILE CAR
ORG_REPEadfTMEAMT /D11 = &REPEadfTMEAMT;
REPEadfTMEAMT /D11 = &REPEadfTMEAMT + 1;
END
TABLE FILE CAR
PRINT ORG_REPEadfTMEAMT
      REPEadfTMEAMT
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
END



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
September 03, 2014, 09:06 AM
Alan B
Use DEFINE FUNCTIONS:
DEFINE FUNCTION ADD(operand/D20,addition/D20)
ADD/A20 =FTOA(operand+addition,'(D20c)','A20');
END
-RUN
-SET &REPEadfTMEAMT = ADD(6000569885, 1);
-TYPE &REPEadfTMEAMT



Alan.
WF 7.705/8.007
September 03, 2014, 09:15 AM
Rifaz
When arithmetic is requested, internally changed to double precision, so before it is perfomed, changed the results to alpha.
-SET &REPEadfTMEAMT1 = 6000569885; 
-SET &REPEadfTMEAMTA=FTOA((&REPEadfTMEAMT1+1),'(D10)','A13');
-TYPE &REPEadfTMEAMTA 



-Rifaz

WebFOCUS 7.7.x and 8.x
September 03, 2014, 12:55 PM
Doug
Nice... I like that...
September 04, 2014, 03:06 AM
TKMAN
thank you-

very much !!


-----------------------------
PROD WF 7.7.02, PMF 5.2.3, MSQL 2005
QA WF 7.7.02, PMF 5.2.3, MSQL 2005
Primarily self-service; adapters: SAP BW, SAP R/3, SQL Server, FlexEnable
Windows, all output
September 04, 2014, 04:03 PM
George Patton
If I remember my first year computer science correctly, they gave us an exercise where the object was to add a series of extremely long numbers - and the answer was to turn them into alpha just as is suggested here ... Smiler


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP