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] Removing quotes from a variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Removing quotes from a variable
 Login/Join
 
Gold member
posted
I have a variable that has quotes around it, and it's necessary to remove said quotes from the variable. How would I do that? I've tried to use things like STRIP, but it doesn't seem to like the fact that I'm passing a variable into it instead of a field name

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2.01M on Windows 10
 
Posts: 54 | Registered: July 30, 2018Report This Post
Silver Member
posted Hide Post
Is it the value contained within the variable that has quotes or your variable is '&var' in your code?

Have you tried =&var.QUOTEDSTRING in place of ='&var'?


WF Version 8105
 
Posts: 45 | Registered: October 07, 2015Report This Post
Master
posted Hide Post
Can you give a code example using the CAR file?


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Gold member
posted Hide Post
My variable is either a 'Y' or 'N'. Using &var.QUOTEDSTRING gives me '''Y''' or '''N'''.


WebFOCUS 8.2.01M on Windows 10
 
Posts: 54 | Registered: July 30, 2018Report This Post
Virtuoso
posted Hide Post
Not clear : are you saying that you have a variable that contains quotes that you want to remove or that the variable is surrounded by quotes ?

If your variable has quotes around it such as below, remove it
-DEFAULTH &CNTRY = 'ENGLAND'
TABLE FILE CAR
SUM SEATS
BY CAR
WHERE COUNTRY EQ '&CNTRY';
END

-* Can be replaced by
TABLE FILE CAR
SUM SEATS
BY CAR
WHERE COUNTRY EQ &CNTRY.QUOTEDSTRING;
END


Below code is removing quotes from variable's content:
-SET &VAR = '''MYVARWITHQUOTES''';
-SET &NVAR = REPLACE(&VAR, '''', '');
-TYPE VAR: &VAR, NVAR: &NVAR

It seems that you already receive the variable content with quotes (this is an option within IB Composer) so, do add any in the where clause neither .QUOTEDSTRING
Have your code as
-DEFAULTH &CNTRY = '''ENGLAND'''
TABLE FILE CAR
SUM SEATS
BY CAR
WHERE COUNTRY EQ &CNTRY;
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
Try the REPLACE function
 
-SET &VARIABLE = '''Y''';
-TYPE &VARIABLE
-SET &VARIABLE = REPLACE(&VARIABLE, '''', '');
-TYPE &VARIABLE 


Docs: REPLACE: Replacing a String


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Expert
posted Hide Post
Am I correct in thinking that you are receiving this variable from an HTML launch page constructed in WebFOCUS?

If so then go to the control properties and make sure that you are not sending a quoted value and that the control is not set to be a multiple.

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
Expert
posted Hide Post
Apart from all the suggestions, STRIP should work. Used it on &Vars many times


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
Master
posted Hide Post
IBI recommends using REPLACE instead of STRIP. If you run the code below, in the Function description for STRIP it says:
quote:
Removes a character from a string. Use REPLACE instead

TABLE FILE SYSSQLOP
BY CATEGORY
BY FUNCTION
BY FUNCTION_SYNTAX
BY FUNCTION_TYPE
BY FUNCTION_DESC
WHERE FUNCTION EQ 'STRIP' OR 'REPLACE' OR 'STRREP';
ON TABLE SET PAGE-NUM OFF
END
  

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


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Expert
posted Hide Post
In 8.1.04 it says "Removes a character from a string. Use STRREP instead."


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
Master
posted Hide Post
quote:
Originally posted by Waz:
In 8.1.04 it says "Removes a character from a string. Use STRREP instead."

LOL, go figure. What does STRREP say in 8104? In 8202 it says:
quote:
Text modification, replace character strings. Use REPLACE instead.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Expert
posted Hide Post
quote:
LOL, go figure. What does STRREP say in 8104?


It says "Text modification, replace character strings"

And it comes under "Character" not "Character - Legacy"


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
Master
posted Hide Post
Figures. IBI is consistent in their inconsistencies.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Expert
posted Hide Post
I guess that is an oxymoron.


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] Removing quotes from a variable

Copyright © 1996-2020 Information Builders