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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Leading zeros
 Login/Join
 
Member
posted
I have a character that I am trying to lose the leading zeros. Initially it is an Integer that is maxed. Then it is converted to alphanumeric. The problem is that I don't know how many leading zeros there are going to be so I don't think a simple edit will work. I tried editing the integer format to remove the leading zeros but when I convert to Alphanumeric, they show back up. I truly just want to drop any zeros in front of the numbers I need to report. It may be 2, 3, or 4 leading zeros. Any suggestions? Thanks for any help.
 
Posts: 29 | Registered: June 19, 2006Report This Post
Virtuoso
posted Hide Post
Look into the FTOA function, that might help with what you want.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Guru
posted Hide Post
Alternatively, you could use the TRIM function.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Platinum Member
posted Hide Post
Or, you might use the STRREP function to replace the leading 0s with blanks?

Kevin


WF 7.6.10 / WIN-AIX
 
Posts: 141 | Location: Denver, CO | Registered: December 09, 2005Report This Post
Expert
posted Hide Post
STRREP is a function only available in v7 and above and it appears to replace ALL of the selected characters, including the 0 in 101, for instance.

As Leah mentioned, the FTOA function will do what you need.

Cheers.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
raise your hands if you remember the good old days when NEW/A8=EDIT(OLD); did NOT pack with leading zeros, but rather you had to force in the leading zeros if you wanted them: NEW/A8L=EDIT(OLD);




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Guilty Red Face
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Thank you!! STRREP worked!!


WebFocus 7.6.6 Win 2K
 
Posts: 29 | Registered: June 19, 2006Report This Post
Expert
posted Hide Post
Does STRREP remove the zero in 101? If so, is this wahat you want?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Hi Francis,
The STREP function did not seem to remove those 0's (i.e. 210 goes to 21). That is the result I wanted. In outputs, I get 110.00 and 220.00 at quick glance. Below is the entire sequence of code I used.

TOT_CHG_D15/D15.2c = PROCEDURE_ACTUAL_CHARGE;
PRT_TOT_CHG/A17 = FTOA (TOT_CHG_D15, '(D15.2c)', PRT_TOT_CHG);
PRT_TOT_CHG2/A17 = STRREP(17,PRT_TOT_CHG,1,' ',0,'X',16,PRT_TOT_CHG2);
PRT_TOT_CHG3/A17V =PRT_TOT_CHG2;
TTLSVCCHG/A17V = IF PRT_TOT_CHG3 EQ '.00' THEN '0.00' ELSE PRT_TOT_CHG3;

Thanks again for the help!

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


WebFocus 7.6.6 Win 2K
 
Posts: 29 | Registered: June 19, 2006Report This Post
Master
posted Hide Post
change this line of code and try,

PRT_TOT_CHG/A17 = FTOA (TOT_CHG_D15, '(D15c)', PRT_TOT_CHG);

Hope it helps,


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders