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     [CLOSED NOT SOLVED] STRREP - Is this expected behaviour?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED NOT SOLVED] STRREP - Is this expected behaviour?
 Login/Join
 
Expert
posted
STRREP (inlength, instring, searchlength, searchstring, replength, repstring, outlength, output)

It seems that if the inlength is less than the searchlength, the output is blank.

See code below. I was expecting the value of VAR2 to be “D”, just like the value of VAR1. But because the length of the data in VAR1 is less than the length of the string to be replaced, the output is blank.

-SET &ECHO=ALL;

-SET &VAR1 = 'D';

-SET &VAR2 = STRREP (&VAR1.LENGTH, '&VAR1.EVAL', 2, 'ZZ', 4, 'BBBB', 1500, 'A1500');

-TYPE VAR1: &VAR1
-TYPE VAR2: &VAR2

Is this expected behaviour?

This message has been edited. Last edited by: Francis Mariani,


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 know for the SUBSTR function, when the end length is greater than the inlength, it returns spaces.

end
Integer
Is the ending position of the substring.
If this argument is less than start or greater than length, the function returns spaces.

So, I would think yes.
Just an opinion.
 
Posts: 229 | Location: New York | Registered: July 27, 2004Report This Post
Expert
posted Hide Post
The documentation is pretty lite on detail.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Hi Francis,
I'm sure you have already thought/done this, but, this is what we do to circumvent:
  
-SET &ECHO=ALL;
-SET &VAR1 = 'D';
-SET &VAR2 = IF &VAR1 CONTAINS 'ZZ' THEN STRREP (&VAR1.LENGTH, '&VAR1.EVAL', 2, 'ZZ', 4, 'BBBB', 1500, 'A1500') ELSE &VAR1;
-TYPE VAR1: &VAR1
-TYPE VAR2: &VAR2
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Hi guys,

I also found this problem with STRREP about two years ago and reported this to IBI in a case (80732511).
After more than one year the only response on this case was just:

"Thank you for bringing this problem to our attention. We have reviewed it
with our engineering staff and it has been determined that it will not be
implemented in the WebFOCUS product. Therefore, we will close the case.
If this decision substantially impacts your business, please discuss with
your local account support team.
Sincerely,"


And after a complaint of the closure of my case without resolving it:
"The description of behavior at the beginning of the
Using Functions Manual makes it pretty clear that errors
introduced by incorrect parameter handling can produce problems
and that the programmer is responsible for ensuring that the
problems are dealt with."


After that experience with IBI I almost gave up and very rarely raise any Cases with them...

btw. In the docu of searchlength they state "Is the number of characters in the (shorter length) string to be replaced." - probably (shorter length) should be enough for us to know
that the function returns an empty string once the searchstring is longer than the instring.

Cheers Linne


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Expert
posted Hide Post
quote:
After that experience with IBI I almost gave up and very rarely raise any Cases with them...


Linne, that type of comment from Tech Support would make me open more cases, if only to annoy them...


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
I also had a bundle of cases closed.

I think they just wanted to clean out the lists of old or less important cases.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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     [CLOSED NOT SOLVED] STRREP - Is this expected behaviour?

Copyright © 1996-2020 Information Builders