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] Split the string based on delimiter

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Split the string based on delimiter
 Login/Join
 
Member
posted
Hi ,

We have input data with delimited string ,
how to split the String based on the delimiter.

-SET &input_data= 'England;Germany;Japan;France';

Needed Output Format
England
Germay
Japan
France

Could you please let us know how to achieve it ?
Thanks

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


WebFOCUS 8

Windows, All Outputs
 
Posts: 16 | Registered: March 28, 2018Report This Post
Virtuoso
posted Hide Post
Take a look at he character functions here, specifically GETTOK and SUBSTR and SPLIT.

https://webfocusinfocenter.inf...urce/character28.htm

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


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
Here's a Dialogue Manager example ...

-*
-SET &IN_STR  = 'England;Germany;Japan;France';
-SET &IN_DLM  = ';';
-*
-TYPE ---------------------------------------------------------
-TYPE IN_STR --- &IN_STR
-TYPE IN_DLM --- &IN_DLM
-TYPE ---------------------------------------------------------
-SET &Z1_DLM = &IN_DLM;
-SET &Z1_STR = TRUNCATE(&IN_STR) | &Z1_DLM;
-SET &Z1_LEN = ARGLEN(&Z1_STR.LENGTH, &Z1_STR, 'I3');
-SET &OT_STR = '`';
-REPEAT :Z1_LOOP FOR &I FROM 1 TO &Z1_LEN;
-SET &Z1_CHA = SUBSTR(&Z1_LEN, &Z1_STR, &I, &I, 1, 'A1');
-IF &Z1_CHA EQ &Z1_DLM THEN GOTO :Z1_OUT;
-SET &OT_STR = IF &OT_STR EQ '`' THEN &Z1_CHA ELSE &OT_STR | &Z1_CHA;
-GOTO :Z1_LOOP
-:Z1_OUT
-TYPE OT_STR --- &OT_STR
-SET &OT_STR = '`';
-:Z1_LOOP
-TYPE ---------------------------------------------------------
-RUN


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Member
posted Hide Post
quote:
Originally posted by jfr99:
Here's a Dialogue Manager example ...

-*
-SET &IN_STR  = 'England;Germany;Japan;France';
-SET &IN_DLM  = ';';
-*
-TYPE ---------------------------------------------------------
-TYPE IN_STR --- &IN_STR
-TYPE IN_DLM --- &IN_DLM
-TYPE ---------------------------------------------------------
-SET &Z1_DLM = &IN_DLM;
-SET &Z1_STR = TRUNCATE(&IN_STR) | &Z1_DLM;
-SET &Z1_LEN = ARGLEN(&Z1_STR.LENGTH, &Z1_STR, 'I3');
-SET &OT_STR = '`';
-REPEAT :Z1_LOOP FOR &I FROM 1 TO &Z1_LEN;
-SET &Z1_CHA = SUBSTR(&Z1_LEN, &Z1_STR, &I, &I, 1, 'A1');
-IF &Z1_CHA EQ &Z1_DLM THEN GOTO :Z1_OUT;
-SET &OT_STR = IF &OT_STR EQ '`' THEN &Z1_CHA ELSE &OT_STR | &Z1_CHA;
-GOTO :Z1_LOOP
-:Z1_OUT
-TYPE OT_STR --- &OT_STR
-SET &OT_STR = '`';
-:Z1_LOOP
-TYPE ---------------------------------------------------------
-RUN



Thank you , this works well !!


WebFOCUS 8

Windows, All Outputs
 
Posts: 16 | Registered: March 28, 2018Report 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] Split the string based on delimiter

Copyright © 1996-2020 Information Builders