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     convert alfanumeric filed in numeric

Read-Only Read-Only Topic
Go
Search
Notify
Tools
convert alfanumeric filed in numeric
 Login/Join
 
Silver Member
posted
Hi
i have field in focus like type is A17. (this filed contains 12345678,99)
I want display to P15.2 format.
Please how to solve this problem.
 
Posts: 31 | Location: roma | Registered: August 18, 2005Report This Post
Virtuoso
posted Hide Post
Try your documentation - ATODBL


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
As Darin says atodbl works; we did have an issue with a very large number losing the last digits value. Not sure if it will like the imbedded comma or not.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
Hi roby,

Has this issue been resolved? Many thanks to Darin and Leah's input.

Please try the following code:

DEFINE FILE EMPDATA     
-*if input has no commas                                         
MYA15A/A15='12345678.00';                                        
MYP152/P15.2=ATODBL(MYA15,'15','D15.2');  
-*if input has commas                       
MYA15C/A15='12,345,678.00';                                      
MYA15NC/A15=EDIT((RJUST(15,MYA15C,'A15')),'9$99$999$999999');    
MYP15WC/P15.2=ATODBL(MYA15NC,'15','D15.2');                      
END                                                              
TABLE FILE EMPDATA                                               
PRINT LN NOPRINT                                                 
MYA15A AS 'ALPHA 15'                                             
MYP152 AS 'P15.2'                                                
MYA15C AS 'ALPHA 15, WITH COMMAS'                                
MYA15NC AS 'ALPHA 15,COMMAS REMOVED'                             
MYP15WC AS 'P15.2 OF,WITHOUT COMMAS'


Hope this helps. Big Grin

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Virtuoso
posted Hide Post
Kerry is to be commended for sending an actual solution.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
If the comma is always on the same position you can do this

FIRST/P14.2=EDIT(ORIGINAL,'99999999999999$$$');
-* this holds the first 14 characters as a number
SECOND/P5.2=EDIT(ORIGINAL,'$$$$$$$$$$$$$$$99')/100;
RESULT/P15.2=FIRST+SECOND;

If the comma is not always on the same position you fist have to find that position with the function POSIT

COMMA/I2 = POSIT(ORIGINAL, 17, ',', 1, 'I2');

Based on the result you do more or less the same.
remove the comma from the string with STRREP function and then convert the string to a number.

Now that number is to big, it has to be divided by 10, 100, 1000 or 10.000 based on the position the comma was.

suppose the result of the formula COMMA was 13, than the divider is:

17-13=4 that makes 10^4 is 10.000

I hope this helps.

If you want to display the result as a value with a comma than use the SET command
SET CDN=ON




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
Virtuoso
posted Hide Post
Sometimes you learn things a little better if you have to do some of the work yourself. IMO, if it's pretty clear in the docs (which is not always the case) you should try that first instead of asking others to fix your problem.

But yes, Kerry is very helpful and consistently follows up on issues. Thanks.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
I'm with you there Darin.

Posting a solution is OK in most situations but where there is a distinct lack of training it does nothing to help the individual, and their management must be rubbing their hands when they think of all the free work they're getting done for them!

I'm all for helping those who show an attempt at solving their problem by stating what they have so far ....

Off the soapbox I go .. Wink

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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     convert alfanumeric filed in numeric

Copyright © 1996-2020 Information Builders