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     [SOLVED] How to concatenate strings with single quote (apostrophe)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to concatenate strings with single quote (apostrophe)
 Login/Join
 
Platinum Member
posted
For examle, if &A=['abc','def'], and I code:

-SET &C=&A | &B;

The program will blow up because webfocus interprets it as

-SET &C='abc','def' | &B.

I tried QUOTEDSTRING and STRREP but neither works because the client is running ver 4.3.6.

What else can I do?

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


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Guru
posted Hide Post
what about :
-SET &C = &A.EVAL&B.EVAL;


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by Glenda:
what about :
-SET &C = &A.EVAL&B.EVAL;


Doesn't work. Same result as above.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Expert
posted Hide Post
what is the value of &B?


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
This works in v5.3.2 and probably should in v4.3.6:

-SET &A = '''abc'',''def''';

-SET &B = 'XXX';

-SET &C = &A | &B;

-TYPE A: &A
-TYPE B: &B 
-TYPE C: &C 



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
Virtuoso
posted Hide Post
quote:
Originally posted by bug:
if &A=['abc','def'], and I code:
-SET &C=&A | &B;
The program will blow up because webfocus interprets it as
-SET &C='abc','def' | &B.


When it "blows up", what's your error message? What code is used to set &A and &B in the first place?

Note that the space before the | is essential; without the intervening space, the | just acts as a name delimiter, rather than a catenation operator.

This code:
  
-SET &ECHO=ALL;
-SET &xA='[''123'',''456'']';
-SET &xB='[''abc'',''def'']';
-? &x
-SET &xC= &xA | &xB ;
-? &x
-SET &xC= &xA| &xB ;
-? &x

...generates this echo:
 -SET &ECHO=ALL;
 -SET &xA='[''123'',''456'']';
 -SET &xB='[''abc'',''def'']';
 CURRENTLY DEFINED & VARIABLES STARTING WITH 'x':
 &xA           = ['123','456']
 &xB           = ['abc','def']
 -? &x
 -SET &xC= ['123','456'] | ['abc','def'] ;
 CURRENTLY DEFINED & VARIABLES STARTING WITH 'x':
 &xA           = ['123','456']
 &xB           = ['abc','def']
 &xC           = ['123','456']['abc','def']
 -? &x
 -SET &xC= ['123','456'] ['abc','def'] ;
 0 ERROR AT OR NEAR LINE     34  IN PROCEDURE _ADHOCRQFOCEXEC *
 (FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
OK, guys. I found something interesting here:

I was testing on MRE (the java applet) when I had the error. Error message was:

-SET &ABC= 'COM','FRM' | 'ABC' ;
0 ERROR AT OR NEAR LINE 24 IN PROCEDURE _CPMAccuFOCEXEC *
(FOC260) AN OPERATION IS MISSING AN ARGUMENT

However, when I test it in the web environment(ibiweb.exe?IBIF_ex=...), it works without any problem.

This can be closed. Thank you all for your help.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Virtuoso
posted Hide Post
remember that single quote marks embedded in a string must be represented by two single quote marks. WebFOCUS treats two contiguous quotes within a quote-delimited string as a single literal quote. There's q pretty lengthy discussion of this in the "Developing Reporting Applications" manual under Customizing a Procedure With a Variable.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
<JG>
posted
quote:
-SET &ABC= 'COM','FRM' | 'ABC' ;


That should not work in any environment

Whtat's the comma doing?
 
Report This Post
Master
posted Hide Post
I'm with JG, I think it needs to be
-SET &ABC='''123','456'''|'''ABC''';


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Seems that's just an execution echo, not the raw fex code. When showing a -SET statement, the echo mechanism shows the values rather than &var names on the RHS. Cf. my earlier response.

Why a problem with MRE and not for self-service? -- I wonder whether MRE's transcription process could cause | to be translated to something else ...


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Bug,

Their are some characters that cause problems within Webfocue. I've encountered this same problem in our Self service applications. We basically take the ebcdic notation and convert code to another...allowable code. So you'll need the ebcdic chart for this method. Below is an example of converting a apostrophes to a graves.

Good Luck,

Timothy



  -* work-around for illegal special characters in a display amper-variable:
-* translate apostrophes to grave` and insert pipes after ampersands:
 AND COMPUTE INCHNAMX/A40=CTRAN(40,INCHNAM,39,96,'A40'); NOPRINT
 AND COMPUTE ZINCHNAM/A40=CTRAN(40,INCHNAMX,38,126,'A40');
 AND COMPUTE DOWNTOX/A20= CTRAN(20,DOWNGRDTO,39,96,'A20'); NOPRINT
 AND COMPUTE ZDOWNTO/A20= CTRAN(20,DOWNTOX,38,126,'A20');




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

 
Posts: 133 | Registered: December 29, 2006Report This Post
<JG>
posted
As Timothy just said you need to use the CTRAN function

To do it in DM as opposed to a define or compute

-SET &A=''''||'123'||''''||','||''''||'456'||'''';
-SET &B=''''||'ABC'||''''||','||''''||'DEF'||'''';
-*
-SET &X=CTRAN(&A.LENGTH, &A, 39, 35, 'A&A.LENGTH');
-SET &Y=CTRAN(&B.LENGTH, &B, 39, 35, 'A&B.LENGTH');
-SET &AB =&X||','||&Y;
-SET &Z=CTRAN(&AB.LENGTH, &AB, 35, 39, 'A&AB.LENGTH');
 
Report 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     [SOLVED] How to concatenate strings with single quote (apostrophe)

Copyright © 1996-2020 Information Builders