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.
Read-Only TopicGo
Search
Notify
Admin
New PM!
Platinum Member posted October 18, 2017 04:53 AM
Hi,
Does anyone no how to split one parameter into multiple parameters.
Excample :
Input : &WEEKNUMBERS = 01 OR 06 OR 10 OR 11
Output: &WEEKNUMBER01 = 01
&WEEKNUMBER02 = 06
&WEEKNUMBER03 = 10
&WEEKNUMBER04 = 11
Thanks Mark
This message has been edited. Last edited by: FP Mod Chuck , October 18, 2017 10:21 AM
Platinum Member Hi
You can use the GETTOK function.
Example
-* 2017-10-18 - Split var based +1 char delimiter.
-DEFAULTH &STR = '01 OR 06 OR 10 OR 11' ;
-DEFAULTH &DEL = ' OR ' ;
-TYPE String...: '&STR'
-TYPE Delimiter: '&DEL'
-* Use 1 char delimiter, comma for example.
-SET &LEN = &STR.LENGTH ;
-SET &STR = STRREP (&LEN, &STR, &DEL.LENGTH, &DEL, 1, ',', &LEN, 'A&LEN.EVAL') ;
-SET &STR = TRUNCATE(&STR);
-SET &LEN = &STR.LENGTH ;
-* Tokens extraction loop.
-SET &I = 0 ;
-SET &SUB = 'X' ;
-REPEAT :LOOPEND WHILE &SUB NE ' ' ;
-SET &I = &I + 1 ;
-SET &SUB = GETTOK(&STR, &LEN, &I, ',', &LEN, 'A&LEN');
-SET &SUB = TRUNCATE(&SUB) ;
-SET &SUB.&I = &SUB ;
-TYPE Substr &I : &SUB.&I
-:LOOPEND
Output
String...: '01 OR 06 OR 10 OR 11'
Del......: ' OR '
Substr 1 : 01
Substr 2 : 06
Substr 3 : 10
Substr 4 : 11
Substr 5 :
Regards. Mikel.
WebFOCUS 8.1.05, 8.2.01
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003
IP
Platinum Member Hi Mikel, Thanks exactly what I needed. Kind Regards Mark
Ignored post by
MrM
posted
October 18, 2017 07:47 AM Show Post
Virtuoso Using WF8 you can also use TOKEN function. It's a little more simplest then GETTOK but do the same.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDFIn Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
IP
Expert I like the new TOKEN function better than GETTOK
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
IP
Platinum Member Doug,
I was working with Token function in WF 8105
and I replaced GETTOK function with TOKEN in Mikel's code it shows error
quote:
(FOC36355) INVALID TYPE OF ARGUMENT #3 FOR USER FUNCTION TOKEN
-DEFAULTH &STR = '01 OR 06 OR 10 OR 11' ;
-DEFAULTH &DEL = ' OR ' ;
-TYPE String...: '&STR'
-TYPE Delimiter: '&DEL'
-* Use 1 char delimiter, comma for example.
-SET &LEN = &STR.LENGTH ;
-SET &STR = STRREP (&LEN, &STR, &DEL.LENGTH, &DEL, 1, ',', &LEN, 'A&LEN.EVAL') ;
-SET &STR = TRUNCATE(&STR);
-SET &LEN = &STR.LENGTH ;
-* Tokens extraction loop.
-SET &I = 0 ;
-SET &SUB = 'X' ;
-REPEAT :LOOPEND WHILE &SUB NE ' ' ;
-SET &I = &I + 1 ;
-*-SET &SUB = GETTOK(&STR, &LEN, &I, ',', &LEN, 'A&LEN');
-SET &SUB = TOKEN(&STR, ',' ,&I );
-SET &SUB = TRUNCATE(&SUB) ;
-SET &SUB.&I = &SUB ;
-TYPE Substr &I : &SUB.&I
-:LOOPEND
It seems that we can not pass Parameter value in number place.
This message has been edited. Last edited by: Chaudhary , November 16, 2017 03:50 AM WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) , 8.2.0.1M , 8.2.0.2 (App-Studio8.2.x), InfoAssist/+, InfoDiscovery Output format:-AHTML, PDF, Excel, HTML Platform:-Windows 7, 8,10
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015
IP
Virtuoso I just tried your code in 8.2.01M and it worked. Which version did you test in?
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
IP
Virtuoso Perform this small change as for WF8105 to work :
-SET &SUB = TOKEN(&STR, ',' ,&I.EVAL);
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDFIn Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
IP
Platinum Member quote:
I just tried your code in 8.2.01M and it worked. Which version did you test in?
BabakNYC I was trying it in WF8105M
WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) , 8.2.0.1M , 8.2.0.2 (App-Studio8.2.x), InfoAssist/+, InfoDiscovery Output format:-AHTML, PDF, Excel, HTML Platform:-Windows 7, 8,10
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015
IP
Platinum Member quote:
Perform this small change as for WF8105 to work : -SET &SUB = TOKEN(&STR, ',' ,&I.EVAL);
Thanks Martin in WF8105 it works with "EVAL"
WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) , 8.2.0.1M , 8.2.0.2 (App-Studio8.2.x), InfoAssist/+, InfoDiscovery Output format:-AHTML, PDF, Excel, HTML Platform:-Windows 7, 8,10
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015
IP
Please Wait. Your request is being processed...
Read-Only TopicCopyright © 1996-2020 Information Builders