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'm getting back a result set that has double quotes in it. for programatic reasons, i want to convert any double quotes to %22. how can i do this? i have no way of knowing in advance where the double quotes will appear or how many ther will be.
Dan, i would suggest using the string functions in the manual 'Using Functions' and there would be a number of ways to do it, depending on the nature of the end result you want. if CTRAN would't work for you then a loop of POSIT and OVRLAY would do the trick. -s Here's a quick table of some useful (well, u b the judge) bytvals for the CTRAN function
ASCII bytvals for ctran function
AMPERSAND 38 DASH 45 APOSTROPHE 39 COMMA 44 QUOTE 34 PERIOD 46 PIPE 124
SLASH 47 BLANK 32 PLUS 43 UNDER 95 LEFTBRKT 60 RIGHTBRKT 62 POUND 35
LEFTPAR 40 RIGHTPAR 41 LEFTBRACE 91 RIGHTBRACE 93 NUMZERO 48 EQUAL 61 DOLLAR 36
ASTERISK 42 UNDERSCORE 95 ZERO 48 EACUTE 233
so your CTRAN would want to change a 34 (quote) to something friendlier, like a single quote 39 or a blank 32. With a single CTRAN on a field, you can nuke all the " and make them something else, regardless of how many.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
-*--------------------------------------------------------------
-* Replace all double quotes with %22
-*--------------------------------------------------------------
-* String to replace
-SET &FIELD = '"abc"def"ghi"';
-* Get the field length
-SET &FIELD_LEN = &FIELD.LENGTH;
-* Initialize variables
-SET &NEWSTR = '';
-SET &IDX = 1;
-* Iterate through the entire string a character at a time
-REPEAT :END_DBL WHILE &IDX LE &FIELD_LEN;
-* Get the next character in the string
-SET &CHARACTER = SUBSTR(&FIELD_LEN, &FIELD, &IDX,
- &IDX, 1, 'A1');
-* Append %22 if a double quote is found,
-* otherwise append the character
-SET &NEWSTR = IF &IDX EQ 1 THEN (IF &CHARACTER EQ '"'
-THEN '%22' ELSE &CHARACTER)
-ELSE IF &CHARACTER EQ '"' THEN &NEWSTR | '%22'
-ELSE &NEWSTR | &CHARACTER;
-* Advance to the next character
-SET &IDX = &IDX + 1;
-:END_DBL
-*--------------------------------------------------------------
-TYPE FIELD : (&FIELD)
-TYPE NEWSTR: (&NEWSTR)
Regards, Sean
------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Posts: 210 | Location: Ottawa | Registered: November 03, 2005
With release 7.x there is a new function called STRREP that should foot the bill precisely. It has been reported that it also works in 5.3.2 upwards but you would have to check. If you going to 7.1.x imminently then it would be worth using it.
ah ha! that STRREP function would have saved me a lot of work over the last two days. byebye 50 lines of code.This message has been edited. Last edited by: GreenspanDan,