Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] how to convert ' OR ' into ',' in webfocus
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] how to convert ' OR ' into ',' in webfocus
 Login/Join
 
Gold member
posted
how to convert ' OR ' into ',' in webfocus
below is code , Could any please help me


-SET &IND_SECT = '11' OR '22' OR '33';
-SET &BEFORE1=''' OR ''';
-SET &AFTER1 =''', ''';
-SET &IND_SECT1=STRREP(&IND_SECT.LENGTH,&IND_SECT, &BEFORE1.LENGTH,&BEFORE1, &AFTER1.LENGTH,&AFTER1, &IND_SECT1.LENGTH,'A&IND_SECT1.LENGTH');

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


WebFOCUS 8202
 
Posts: 61 | Location: India | Registered: March 24, 2014Reply With QuoteReport This Post
Platinum Member
posted Hide Post
How about this ...

-*
-SET &IND_SECT  = '''11'' OR ''22'' OR ''33''';
-SET &IND_SECT1 = TRUNCATE(STRREP(&IND_SECT.LENGTH,&IND_SECT,4,' OR ',1,',',&IND_SECT.LENGTH,A&IND_SECT.LENGTH));
-*
-TYPE IND_SECT -------------- &IND_SECT
-TYPE IND_SECT(LENGTH) ------ &IND_SECT.LENGTH
-TYPE -----------------------
-TYPE IND_SECT1 ------------- &IND_SECT1
-TYPE IND_SECT1(LENGTH) ----- &IND_SECT1.LENGTH


WebFocus 8.201M, Windows, App Studio
 
Posts: 226 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Master
posted Hide Post
Try this:
  
-SET &IND_SECT = '''11'' OR ''22'' OR ''33''';
-SET &IND_SECT1 = REPLACE(&IND_SECT, ' OR ', ', ');

-TYPE &IND_SECT
-TYPE &IND_SECT1


Check out the docs here: REPLACE: Replacing a String

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, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
Check out the docs here: REPLACE: Replacing a String


Another reason we need to upgrade


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: 6291 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Master
posted Hide Post
quote:
Originally posted by Waz:
quote:
Check out the docs here: REPLACE: Replacing a String


Another reason we need to upgrade


Looks looks like your just shy of having REPLACE in your 7610 environment Frowner But is should work in your 8104 Smiler

It became available in 7708.
Functions Reference - Release 7708


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
But is should work in your 8104


I'll check 8.1.04, but its not in the documentation.


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: 6291 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
quote:

But the values are coming ' OR '
-SET &IND_SECT = ''11' OR '22' OR '33'';

do we have any setting to double Quote '' OR '' if it not that case how to we do ' OR '
to ' , '


Please help me




WebFOCUS 8202
 
Posts: 61 | Location: India | Registered: March 24, 2014Reply With QuoteReport This Post
Gold member
posted Hide Post
Are you taking the value from the launch page or from anywhere else like a variable?

If it comes from the launch page then it gives '11' OR '22' OR '33'..... Why the double quote is coming in the beginning and ending - is there any reason!

quote:
how to we do ' OR ' to ' , '

For replacing ' OR ' you can use simple replace function like mentioned above.

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


8202, 8105M, 7.7.03
 
Posts: 79 | Registered: June 12, 2012Reply With QuoteReport This Post
Master
posted Hide Post
quote:
-SET &IND_SECT = ''11' OR '22' OR '33'';


First of all, the set you have in your last post is wrong. It returns:
 (FOC257) MISSING QUOTE MARKS: ';


Secondly, is the value that you are looking to parse like this?
 11 OR 22 OR 33 


Or is it like this:
 '11' OR '22' OR '33'


Either way the formula would be the same. Copy/paste the code below into a blank procedure in AppStudio and run it:
  
-SET &ECHO=ALL;
-*
-*vvvvvvv NO QUOTES AROUND EACH VALUE vvvvvvvvvvvvvvvvvvvv
-SET &IND_SECT = '11 OR 22 OR 33';
-TYPE &|IND_SECT: &IND_SECT
-*
-SET &IND_SECT1 = REPLACE(&IND_SECT, ' OR ', ', ');
-TYPE &|IND_SECT1: &IND_SECT1
-*
-*
-*vvvvvvvvvSINGLE QUOTES AROUND EACH VALUE vvvvvvvvvvvvvvvv
-SET &IND_SECT = '''11'' OR ''22'' OR ''33''';
-TYPE &|IND_SECT: &IND_SECT
-*
-SET &IND_SECT1 = REPLACE(&IND_SECT, ' OR ', ', ');
-TYPE &|IND_SECT1: &IND_SECT1


You should get the following output in your browser:

-*
 -*vvvvvvv NO QUOTES AROUND EACH VALUE vvvvvvvvvvvvvvvvvvvv
 -SET &IND_SECT = '11 OR 22 OR 33';
 -TYPE &IND_SECT: 11 OR 22 OR 33
 &IND_SECT: 11 OR 22 OR 33
 -*
 -SET &IND_SECT1 = REPLACE(11 OR 22 OR 33, ' OR ', ', ');
 -TYPE &IND_SECT1: 11, 22, 33
 &IND_SECT1: 11, 22, 33
 -*
 -*
 -*vvvvvvv SINGLE QUOTES AROUND EACH VALUE vvvvvvvvvvvvvvvv
 -SET &IND_SECT = '''11'' OR ''22'' OR ''33''';
 -TYPE &IND_SECT: '11' OR '22' OR '33'
 &IND_SECT: '11' OR '22' OR '33'
 -*
 -SET &IND_SECT1 = REPLACE('11' OR '22' OR '33', ' OR ', ', ');
 -TYPE &IND_SECT1: '11', '22', '33'
 &IND_SECT1: '11', '22', '33'  



I'm not sure what you are asking about a double quote.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Master
posted Hide Post
quote:
I'll check 8.1.04, but its not in the documentation.


Interesting, I don't see it either.

Once again the ambiguity of IBI's version numbering is causing more confusion than answers.

The link above is for "Release 7708," but the "release" of what? The cover of the pdf says "WebFOCUS Functions Reference Release 7708." I don't see a release numbered 7708 anywhere here: http://documentation.informati....com/collections.asp

Does anyone know of a listing of all WebFOCUS functions and the WF Client release that they are first available?


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Master
posted Hide Post
So I finally found out that REPLACE is available beginning in WF 8201M / Reporting Server 7707 8201M Release Notes

The 7708 version in the link above is for the reporting server version for release 8203, but the function is available beginning in RS 7707.

There went half my day crawling through IBI's vague docs for a simple answer


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
quote:

This is the value I'm getting from appstudio
'11' OR '22' OR '33'
And

I want like this and this value I'm using in query
'11' , '22' , '33'



WebFOCUS 8202
 
Posts: 61 | Location: India | Registered: March 24, 2014Reply With QuoteReport This Post
Expert
posted Hide Post
Developer, I think you need to do some training or search the forum some more.

To specify a single quote within single quoted, just use two of them.

-SET &IND_SECT = '''11'' OR ''22'' OR ''33''';

WebFOCUS Dialog Manager converts them to a single quote in the variable.

So to specify the search text use ''' OR '''


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: 6291 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Master
posted Hide Post
quote:
Originally posted by Developer:
quote:

This is the value I'm getting from appstudio
'11' OR '22' OR '33'
And

I want like this and this value I'm using in query
'11' , '22' , '33'



All you need is this:

 
-SET &IND_SECT1 = REPLACE(&IND_SECT, ' OR ', ', ');
 


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
quote:
Originally posted by Developer:
quote:

This is the value I'm getting from appstudio
'11' OR '22' OR '33'
And

I want like this and this value I'm using in query
'11' , '22' , '33'



If you share the code it will be better understanding to us...


8202, 8105M, 7.7.03
 
Posts: 79 | Registered: June 12, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] how to convert ' OR ' into ',' in webfocus

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.