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  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Problem with -READ
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Problem with -READ
 Login/Join
 
Silver Member
posted
Hello,
one of my fields in the database is in P24.7 format.I am doing a -READ on that field.
  
TABLE FILE STAGE
PRINT 
    PROB AS 'V9'
WHERE KEY EQ '&SALES';
ON TABLE HOLD AS HEAD FORMAT ALPHA
END

-READ HEAD &V9.A30.
-SET &A_PROB = EDIT(&V9,'99999999999999999999999999999999');
-SET &MY_PROB = TRUNCATE(&A_PROB);
-SET &MY_PROB1 = &MY_PROB * 100;


The field I am talking about is PROB.
I tried using -READ HEAD &V9.P24.7.,but that does'nt work.
Can somebody correct me.
Thanks
Swetha.

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


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
 
Posts: 39 | Registered: September 03, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Following the

END

Place a

-READ


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 138 | Registered: October 19, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
if you are not sure about the exact length of the field you can put a HOLD command

? HOLD HEAD

start the report with

-SET %ECHO=ALL;

and then you will see what length your field is (I suppose it is A24)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Actually you should have a -RUN after the END from the TABLE FILE.

Also you are READING 30 characters from the file, as the field, and the file will only be 24 bytes, this will also cause problems.

Change the -READ to .A24.

If you want to know how many bytes are in the record, change the HOLD to SAVE.


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: 6105 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
If you want to retain decimal places in calculations made in Dialogue Manager, you will need to set DMPRECISION to an appropriate number of decimal places (ex.: SET DMPRECISION = 7). Otherwise DM will truncate the decimals and display calculated variables as integers.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Just my 2penneth...

I always add -RUN after :

the Hold file
after -READ

this can resolve many problems - I dont have any p24 data to hand to test.

TABLE FILE STAGE
PRINT
PROB AS 'V9'
WHERE KEY EQ '&SALES';
ON TABLE HOLD AS HEAD FORMAT ALPHA
END

-RUN

-READ HEAD &V9.A30.
-RUN

-SET &A_PROB = EDIT(&V9,'99999999999999999999999999999999');
-SET &MY_PROB = TRUNCATE(&A_PROB);
-SET &MY_PROB1 = &MY_PROB * 100;


81.05 All formats
 
Posts: 56 | Location: Manchester | Registered: November 21, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
PBax,

What problems does the -RUN after the -READ solve? It would appear to be unnecessary.

Thanks.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 138 | Registered: October 19, 2010Reply With QuoteReport This Post
Master
posted Hide Post
the -RUN closes the file.

You need to download the WebFOCUS Developing Application Manuals for your release.

With the way you have coded this (HOLDFORMAT ALPHA) all the data in your file is alpha-numeric. There is no binary data. The correct way to code the -READ is:
-READ HEAD &V9.24.


All you need between the .. is the length of the field.

Also, the P, D and F formats, the number following the P, D or F is the total length of the field including any embedded commas, periods or signs.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 919 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Silver Member
posted Hide Post
I changed the read to
-READ HEAD &V9.A24.
This solved my problem.

Thanks.


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
 
Posts: 39 | Registered: September 03, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Problem with -READ

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