Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] How to read Decimal value from a temp SAVE file
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] How to read Decimal value from a temp SAVE file
 Login/Join
 
Gold member
posted
I need to read a decimal value from a temp SAVE file then use it as a variable for further process. I am using technique as
-READ SAVEFILE &Var1.length. &VAR2.length.
But I got error when the &Var contains decimal point. Any suggestion? thanks in advanced.

Here I use CAR table to illustrate my question. I need to compute the Profit as D12.2.
  
TABLE FILE CAR
SUM
     CAR.BODY.RETAIL_COST
     COMPUTE Profit/D12.2 = CAR.BODY.RETAIL_COST * 0.10;
BY  LOWEST CAR.ORIGIN.COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SAVE AS 'SAVE_1' FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-RUN

-READ SAVE_1    &COUNTRY.A10.     &COST.A11.     &PROFIT.A12
-TYPE &COUNTRY  ";"  &COST ";" &PROFIT


My output has error of &PROFIT as :
ENGLAND ";" 45319 ";" 4531.90FRAN

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


WebFocus 7.7.03 ,Unix on IBM zOS;
and WebFocus 8.0 on Window with App Studio
HTML, PDF, Excel
 
Posts: 56 | Registered: March 12, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
As you are using SAVE, what is shown in the save fields ?

It should list each field saves and its format.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6072 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
This works for me, compare your code to mine...
  
TABLE FILE CAR
SUM
     CAR.BODY.RETAIL_COST
     COMPUTE Profit/D12.2 = CAR.BODY.RETAIL_COST * 0.10; NOPRINT
	 COMPUTE PROFIT2/A15 = FPRINT(Profit, 'D12.2', PROFIT2);

BY  LOWEST CAR.ORIGIN.COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS 'SAVE_1' FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-RUN
-SET &XLINES = &LINES;
-REPEAT GET_DATA &XLINES TIMES
-READ SAVE_1 NOCLOSE &COUNTRY.A10. &COST.I7. &PROFIT2.A15.
-TYPE &COUNTRY  ";"  &COST ";" &PROFIT2
-GET_DATA
-EXIT

Output is:
  
 ENGLAND     ";"    45319 ";"       4,531.90
 FRANCE      ";"     5610 ";"         561.00
 ITALY       ";"    51065 ";"       5,106.50
 JAPAN       ";"     6478 ";"         647.80
 W GERMANY   ";"    64732 ";"       6,473.20


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] How to read Decimal value from a temp SAVE file

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.