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] Formatted numeric variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Formatted numeric variables
 Login/Join
 
Gold member
posted
Hi,

I'm creating a html page where a user will enter a numeric values into edit boxes, which will then update a permanent hold file. I want these fields to be stored as numeric values for calculations later on. Ideally the user can enter a value with or without formatting (comma's/decimals). In my example below, I'm getting an error "Result of expression is not compatible with the formal of the field". What am I doing wrong?

-DEFAULT &TOTAL_STATEMENTS = '2,125,162';
-DEFAULT &QTR_GROWTH_FACTOR = '0.991';


TABLE FILE CAR
SUM CAR NOPRINT
COMPUTE TOTAL_PTM_IMAGES/D12 = '&TOTAL_STATEMENTS';
COMPUTE QTR_GROWTH_FACTOR/D3.3 = '&QTR_GROWTH_FACTOR';
END

This message has been edited. Last edited by: Joel Elscott,


WebFOCUS 8.2.03
z/OS
 
Posts: 66 | Registered: May 20, 2013Report This Post
Guru
posted Hide Post
-DEFAULT &TOTAL_STATEMENTS = 2,125,162;
-DEFAULT &QTR_GROWTH_FACTOR = 0.991;


Try it this way

/*

TABLE FILE CAR
SUM CAR NOPRINT
COMPUTE TOTAL_PTM_IMAGES/D12 = &TOTAL_STATEMENTS ;
COMPUTE QTR_GROWTH_FACTOR/D5.3 = &QTR_GROWTH_FACTOR;
END
/*


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Expert
posted Hide Post
quote:
-DEFAULT &TOTAL_STATEMENTS = 2,125,162;

... will not work because of the embedded commas - WF thinks there is continued syntax coming.

So you need to have -DEFAULT &TOTAL_STATEMENTS = '2,125,162'; and then use something like this -
COMPUTE TOTAL_PTM_IMAGES/D12 = EDIT(STRREP(15,&TOTAL_STATEMENTS.QUOTEDSTRING,1,',',0,'x',15,'A15'));

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Sorry but my last answer did not copy right. You cannot in the commas in the amount. Just enter the amount as a number. The report will show with the commas.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Gold member
posted Hide Post
Thanks guys. The numbers are coming from a user entry screen, so I will need to strip out the comma's before I store them. (Which I know how to do)

Thanks again.


WebFOCUS 8.2.03
z/OS
 
Posts: 66 | Registered: May 20, 2013Report 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] Formatted numeric variables

Copyright © 1996-2020 Information Builders