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] replacing a single quote

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] replacing a single quote
 Login/Join
 
Guru
posted
I am trying to replace a single quote with a space. I have tried this

-SET &FFCCNMB = STRREP (25,&FFCCNMB, 1, "'", 1, ' ', 25, 'A25');

also this -SET &FFCCNMB = STRREP (25,&FFCCNMB, 1, ''''', 1, ' ', 25, 'A25');

Any suggestions?

This message has been edited. Last edited by: Jay Potter,


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report This Post
Expert
posted Hide Post
With these functions and a space, you need to add an extra non space but still only give a length of 1.

e.g.
SET &FFCCNMB = STRREP (25,&FFCCNMB, 1, '''', 1, ' X', 25, 'A25');


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
You can also use CTRAN:
-SET &FFCCNMB = CTRAN (25,&FFCCNMB, 39, 32, 'A25');

Or more generally, using BYTVAL to translate a character to its decimal value:
-SET &FFCCNMB = CTRAN (25,&FFCCNMB, BYTVAL('''', 'I3'), BYTVAL(' ', 'I3'), 'A25');


All quotes will become spaces.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
All three worked!!! Thank You very much.

I had to make a small change to the first CTRAN. I failed to say that I am using an iSeries so I had to use EDCDIC values instead.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Report This Post
Expert
posted Hide Post
Consider: CTRAN: Translating One Character to Another.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
I also like CTRAN in these situations.

And because Dialogue Manager does not necessarily have a "format" like a field, you may need to dynamically determine the length of your variable.
You could do something like this:
-SET &TLEN = &FFCCNMB.LENGTH ;
-SET &TFMT = 'A' | &TLEN ;
-SET &FFCCNMB = CTRAN(&TLEN, &FFCCNMB, 39, 32, '&TFMT') ;

Merge that into Daniel's second -SET and you then have a very interesting command ;-)


WebFOCUS 8.2.06 mostly Windows Server
 
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008Report This Post
Virtuoso
posted Hide Post
Twanette,

Very true.
You can also do away with your second DM command:
  
-SET &FFCCNMB = CTRAN(&TLEN, &FFCCNMB, 39, 32, 'A&TLEN.EVAL') ;

BTW, I see many times people using .EVAL when not in a DM command. It doesn't hurt, but then it doesn't help.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
FYI,

You can do away with both lines with:
-SET &FFCCNMB = CTRAN(&FFCCNMB.LENGTH, &FFCCNMB, 39, 32, 'A&FFCCNMB.LENGTH') ;


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     [SOLVED] replacing a single quote

Copyright © 1996-2020 Information Builders