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.
I have been trying to count the number of blank characters there are in each string below:
Peter Piper picked a peck of pickled peppers A peck of pickled peppers Peter Piper picked. If Peter Piper picked a peck of pickled peppers, Where's the peck of pickled peppers Peter Piper picked?
I pine for the old mainframe days when you could use various REXX functions (POS, WORDPOS) to count the # of words etc., in a string. [Oh, and the early Elton John albums were awesome too!]
So far I have used CTRAN to translate the blanks' to '*', but I am stumped on how to accumulate the # of blanks in a string.
Any ideas?
Thanks,This message has been edited. Last edited by: Kerry,
1) Determine the length of the string 2) Strip the blanks out of the string 3) Determine the length of the string without the blanks 4) Determine the number of blanks in the string by subtracting the length of the string without the blanks from the length of the string
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
Many Many years back. I had a simular situation where we needed to know how many times a certain character occurred in a field. We ended up creating our own userwritten subroutine. O the power of WebFOCUS/FOCUS.
I thought, this is simple, I'll add to the post, and found Francis pipped me at the post by a couple of posts.
A great concept to keep in mind. The field will always be the same length. STRIPping the spaces effectively left justifies all text or right justifies all spaces.
It is a bit surprising that there isn't a supplied function to do this. We can easily convert my DEFINE code into a DEFINE FUNCTION so that it can be called from any program, passing only the character to be counted. One thing to remember is that if the character to be counted is not a space, then the existing spaces have to be CTRANed to something else before CTRANing the character to be counted!
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