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     Using strrep to replace a period

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using strrep to replace a period
 Login/Join
 
Platinum Member
posted
I am attempting to strip out the period located within my username to allow me to make a nice pretty title. Any thoughts on the problem behind this one? It complains about the period. It will work with other characters.

STRREP(&USR.LENGTH, '&USR.EVAL', 1, '.', 1, 'X', &USR.LENGTH, 'A&USR.LENGTH')

Error: INVALID TYPE OF ARGUMENT #4 FOR USER FUNCTION STRREP


WebFOCUS 8201M/Windows Platform
 
Posts: 109 | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
nevermind...

I searched on the error message and found this piece of advice.."Concat an empty string to the end to force into an alphanumeric" so...

STRREP(&USR.LENGTH, '&USR.EVAL', 1, '.' | '', 1, ' ' | '', &USR.LENGTH, 'A&USR.LENGTH');


WebFOCUS 8201M/Windows Platform
 
Posts: 109 | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Or you could use CTRAN to replace one character by another.

-DEFAULT &USR = 'Francis.Mariani';
-SET &USR1 = CTRAN(&USR.LENGTH, &USR, BYTVAL('.','I2'), BYTVAL(' ','I2'), 'A&USR.LENGTH');

-TYPE &USR / &USR1

In my example, using BYTVAL avoids having to use the ASCII/EBCDIC decimal values for the character to be replaced and makes the CTRAN function platform-independent.


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
Platinum Member
posted Hide Post
I don't know if this is the same issue or not, but we've had issues with "short" strings and using STRREP sometimes completely strips out all of the characters.

In the end, our solution is exactly what you've found -- concatenate some spaces to the end. I've always thought this strange, but for us it seemed to be more frequent on strings that were less than say 4 characters or so.



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report 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     Using strrep to replace a period

Copyright © 1996-2020 Information Builders