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 am reading a table and putting the data into variables. I then need to strip the apostrophes from the variable because it will be used in a sql statement later and the apostrophes are erroring in the select statement. Here is my code. Any suggustions would be appreciated. I am running the type commands to help trouble shoot the results.
Thanks
-RUN -READ FAS_PICK_RESULT &TDEPT_CD.10. &TFUND_CD.A10. &TTITLE.A82. -TYPE '&TDEPT_CD' -TYPE '&TFUND_CD' -TYPE '&TTITLE' -SET &TTITLE1 = STRIP(&TTITLE, 82, '-', 'A82'); -TYPE &TTITLE1This message has been edited. Last edited by: Kerry,
Posts: 7 | Location: Frankfort, KY | Registered: June 25, 2007
Mike here's a snippet of code that will help you understand R2's answer. you want to extract the byte value for the apostrophe (39), and replace it using the CTRAN function for something else, in this case a quote mark (byte value 34)
DEFINE FILE CAR
atsign/I4 WITH CAR = BYTVAL('@', 'I4');
EACUTE/I4 WITH CAR=BYTVAL('é','I4');
ZERO/I4 WITH CAR=BYTVAL('0','I4');
AMPERSAND/I4 WITH CAR=BYTVAL('&','I4');
DASH/I4 WITH CAR=BYTVAL('-','I4');
APOSTROPHE/I4 WITH CAR=BYTVAL('''','I4');
QUOTE/I4 WITH CAR=BYTVAL('"','I4');
COMMA/I4 WITH CAR=BYTVAL(',','I4');
PERIOD/I4 WITH CAR=BYTVAL('.','I4');
SLASH/I4 WITH CAR=BYTVAL('/','I4');
BKSLASH/I4 WITH CAR=BYTVAL('\','I4');
BLANK/I4 WITH CAR=BYTVAL(' ','I4');
PLUS/I4 WITH CAR=BYTVAL('+','I4');
UNDER/I4 WITH CAR=BYTVAL('_','I4');
LEFTBRKT/I4 WITH CAR=BYTVAL('<','I4');
RIGHTBRKT/I4 WITH CAR=BYTVAL('>','I4');
LEFTBRACE/I4 WITH CAR=BYTVAL('[','I4');
RIGHTBRACE/I4 WITH CAR=BYTVAL(']','I4');
POUND/I4 WITH CAR=BYTVAL('#','I4');
LEFTPAR/I4 WITH CAR=BYTVAL('(','I4');
RIGHTPAR/I4 WITH CAR=BYTVAL(')','I4');
DOLLAR/I4 WITH CAR=BYTVAL('$','I4');
PIPE/I4 WITH CAR=BYTVAL('|','I4');
ASTERISK/I4 WITH CAR = BYTVAL('*','I4');
UNDERSCORE/I4 WITH CAR = BYTVAL('_','I4');
EQUAL/I4 WITH CAR = BYTVAL('=','I4');
END
-RUN
TABLE FILE CAR
HEADING
"ASCII bytvals for ctran function"
PRINT atsign AMPERSAND DASH APOS COMMA QUOTE PERIOD PIPE
OVER SLASH BLANK PLUS UNDER LEFTBRKT RIGHTBRKT POUND
OVER LEFTPAR RIGHTPAR LEFTBRACE RIGHTBRACE NUMZERO EQUAL DOLLAR
OVER ASTERISK UNDERSCORE ZERO EACUTE BKSLASH
IF RECORDLIMIT IS 1
END
Lookup the HEXBYT function and perhaps the BITVAL as well, and add them to your repertoire. Hope this helps. s
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Another option is to use the STRREP function to replace a single apostophe with two. For us, the most common situation is using sql to update names. For example, take the last name of O'Neil. If I use STRREP to make the string O''Neil, then the SQL works just fine and I preserve the apostrophe.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006