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] Replacing in a String Dynamically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Replacing in a String Dynamically
 Login/Join
 
Gold member
posted
I have a Scenario in report where i have to replace a string.From a HTML page i get a string in the format of STR1 = 'X1' AND 'X2' AND 'X3'

This string needs to be converted in to the format of STR1 = X1 + X2 + X3 removing both the quotes and the AND replaced by a plus sign and add to this the string is always dynamic.Is there any solution for this.

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


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


 
Posts: 68 | Location: Hyderabad | Registered: March 18, 2008Report This Post
Virtuoso
posted Hide Post
there are many ways to replace characters in a string.

did you look at the several formulas?




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
Expert
posted Hide Post
Check out the Using Functions documentation.

http://documentation.informati....htm?url=topic14.htm


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
Virtuoso
posted Hide Post
Check out this thread on a similar case which might give you some ideas: Search and Replace paying particular attention to the STRREP function.

- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
thanks for the solutions of which most of them almost worked.I am not able to use the STRREP function to replace AND with a '+' Sign.The Error is something like invalid argument in the fucntion.Is this because this being an operator?? and the other problem is with the single quote .How will it recognize the ' and replace it coz
-SET &V1 = ' 'a' OR 'b' OR 'c' OR 'd' OR 'e'' ;

-SET &V2 = STRREP(&V1.LENGTH, &V1, 1, ''', 1, ' ', &V1.LENGTH, 'A&V1.LENGTH');
would be an invalid specification


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


 
Posts: 68 | Location: Hyderabad | Registered: March 18, 2008Report This Post
Virtuoso
posted Hide Post
Try this code. The STRIP function is used to remove the single quotes. STRREP does not like the + sign so I replaced 'AND' with '^', then used CTRAN to replace the '^' with '+'. I used a length of 100, but you should adjust this length to the maximum expected length of your input string. Also be aware that the output length for STRREP must be longer than the input length.

-SET &STR1 = '''X1'' AND ''X2'' AND ''X3''';
-SET &LEN1 = ARGLEN(100,&STR1,'I2');
-SET &STR2 = STRIP(&LEN1,&STR1,'''','A&LEN1');
-SET &STR3 = STRREP(&LEN1,&STR2,3,'AND',1,'^',100,'A100');
-SET &STR4 = CTRAN(100,&STR3,94,43,'A100');


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Working on a Sunday. thats dedication.
Smiler


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
quote:
Working on a Sunday. thats dedication
... or boredom!

Happy New Year all

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
Virtuoso
posted Hide Post
quote:
... or boredom!


Tony is closer to the mark. While awaiting the appointed hour to perform my duty as parental chauffeur it came down to a choice between an interesting Focal Point problem and the mindless drivel they call entertainment on the telly.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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] Replacing in a String Dynamically

Copyright © 1996-2020 Information Builders