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     [SOLVED] Problem with -READ

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2010Report This Post
Platinum Member
posted Hide Post
Following the

END

Place a

-READ


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report 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, 2006Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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, 2007Report 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, 2006Report This Post
Platinum Member
posted Hide Post
PBax,

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

Thanks.


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report 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: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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, 2010Report 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     [SOLVED] Problem with -READ

Copyright © 1996-2020 Information Builders