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] Convert alpha to numeric after readfile

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert alpha to numeric after readfile
 Login/Join
 
Guru
posted
I have 2 variables created from a readfile command that are intergers. I also have 2 variables created from a readfile command that are D9.2. I am trying to use these variables to create percentage variables. I originally tried to just divide the 2 variables, but I got an error indicating I was trying to calculate alpha variables. I also have tried the following commands. I keep getting the value of 0.

-SET &NUMBEROFRX_PER = (ATODBL(&NUMBEROFRX_25, '13', I6)/ATODBL(&NUMBEROFRX_ALL, '13', I6)) * 100;

-SET &HOSPICECHARGE_PER = (ATODBL(&HOSPICECHARGE_25, '13', D9.2)/ATODBL(&HOSPICECHARGE_ALL, '13', D9.2)) * 100;

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report This Post
Virtuoso
posted Hide Post
It does work well Jay, maybe you have another issue. Maybe precision ?
SET DMPRECISION = 2
DEFINE FILE CAR
RC /P9.2 = RETAIL_COST + .25;
DC /P9.2 = DEALER_COST + .33;
END
TABLE FILE CAR
PRINT RC DC
BY COUNTRY NOPRINT
WHERE COUNTRY EQ 'FRANCE';
ON TABLE SAVE AS HLD FORMAT ALPHA
END
-RUN

-READ HLD &RCOST.I9. &DCOST.I9.
-RUN

-TYPE &RCOST, &DCOST

-SET &RATE = &RCOST / &DCOST;
-TYPE &RATE
-SET &RATE2 = ((ATODBL(&RCOST, '9', P9.2) + 1.25) * 15) / (ATODBL(&DCOST, '9', P9.2) + 4.33);
-TYPE &RATE2


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Guru
posted Hide Post
Thanks for at least confirming that the command I was using was correct. I backed up a few steps and started again and I got it to work. Who knows what I did wrong the first time.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report 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] Convert alpha to numeric after readfile

Copyright © 1996-2020 Information Builders