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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Tokenizing
 Login/Join
 
<Navin>
posted
I have the string like 987,654,321 i want to convert this to 987','654','321 .

How to convert this?
My String length will be differenat at run time . But the comms place is static , 3rd position only

Can we use this without GETTOK ??

Thanks
Naveen.

This message has been edited. Last edited by: Kerry,
 
Report This Post
Expert
posted Hide Post
Try the String Replace function to replace , with ','.

STRREP: Replacing Character Strings


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Navin,

This may help you :
  
-SET &IN_VAL='456,232,232,2323,2323,23232,456,77676,56666';
-DEFAULT &CTR=0;
-DEFAULT &COUNTER =0;
-REPEAT ENDREPEAT WHILE &COUNTER NE 100
END
-SET &COUNTER = &COUNTER +1;
-SET &Var1=GETTOK(&IN_VAL,&IN_VAL.LENGTH,&COUNTER,',',40,'A40');
-IF &Var1 NE '' THEN LOOP1 ELSE GOTO LOOPEND;
-LOOP1
-SET &CTR = &CTR + 1;
-LOOPEND
-ENDREPEAT


-DEFAULT &COUNTER1 =0;
-DEFAULT &VALUE=' ';
-DEFAULT &NEW_VAL='';
-REPEAT ENDREPEAT1 WHILE &COUNTER1 LT &CTR
END
-SET &COUNTER1 = &COUNTER1 +1;
-SET &Var2=GETTOK(&IN_VAL,&IN_VAL.LENGTH,&COUNTER1,',',10,'A10');

-SET &VALUE = &VALUE |TRUNCATE(&Var2) |'","';
-SET &NEW_VAL=CTRAN(&VALUE.LENGTH,&VALUE,34,39,A400);
-TYPE &NEW_VAL


Thanks


WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV
 
Posts: 25 | Location: Chennai | Registered: August 27, 2008Report This Post
Silver Member
posted Hide Post
Check This Code

quote:
-SET &IN_VAL='456,232,232,2323,2323,23232,456,77676,56666';
-SET &VALUE = STRREP(100,&IN_VAL,1,',',4,''',''',100,A100);
-TYPE &VALUE


thanks Allen


----------------------------------
Prod Version:WebFocus 8.1.05,OS:Unix ,Output:ALL
 
Posts: 29 | Location: North Carolina | Registered: August 26, 2008Report This Post
Expert
posted Hide Post
Navin, is this string a single field in a report or are the groups of 3 digits multiple fields ?


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
<Navin>
posted
This Issue is solved . .

We got it using ,
STRREP(100,&CUSIP_VAL,1,',',4,''',''',800,A800);

Thanks all for your support.
 
Report This Post
Expert
posted Hide Post
Francis,

Thanks for the refresher on STRREP. This is one of those command names that I just could not remember.

I needed to change the commas in a list of user ids to ", @something.com" to fillout the list of email addresses. the techniques worked like a charm.

Good One
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders