Focal Point
[CLOSED] how to convert ' OR ' into ',' in webfocus

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9257023096

June 05, 2018, 09:17 AM
Developer
[CLOSED] how to convert ' OR ' into ',' in webfocus
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
June 05, 2018, 09:53 AM
jfr99
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
June 05, 2018, 02:56 PM
Hallway
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:
 
 
 
 
June 05, 2018, 05:13 PM
Waz
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!

June 06, 2018, 02:30 PM
Hallway
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:
 
 
 
 
June 06, 2018, 05:05 PM
Waz
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!

June 07, 2018, 07:47 AM
Developer
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
June 07, 2018, 10:30 AM
Dev
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
June 07, 2018, 10:51 AM
Hallway
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:
 
 
 
 
June 07, 2018, 11:53 AM
Hallway
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:
 
 
 
 
June 07, 2018, 12:23 PM
Hallway
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:
 
 
 
 
June 07, 2018, 02:32 PM
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'




WebFOCUS 8202
June 07, 2018, 05:05 PM
Waz
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!

June 07, 2018, 07:06 PM
Hallway
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:
 
 
 
 
June 08, 2018, 07:03 AM
Dev
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