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     [CLOSED] GETTOK CTRAN and STRREP

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] GETTOK CTRAN and STRREP
 Login/Join
 
Member
posted
I have a string which is actually several fields separated by a euro symbol (dec 128).

I wanted to use GETTOK to separate the fields, but GETTOK only returns the first field. My alternate strategy was to replace the euro characters with an asteriks, but that didn't work either.

what perplexes me is we also have decimal 253 characters that translate fine in all 3 commands

I'd appreciate any suggestions...

any way these are the 3 commands that fail to produce the results I want

(in define)
STR/A2000 = CTRAN(2000, STR1, 128, 42, STR);
STR/A2000 = STRREP(2000, STR1, 1, '€', 1, '*', 2000, STR);
STR/A100 = GETTOK(STR, 2000, 1, '€', 1, STR);
STR2/A100 = GETTOK(STR, 2000, 2, '€', 1, STR2);




this is a sample of my string
RýD€TG52132€SU/SP€FXSUSP€FAWI€2012ý2013ý2014€€A

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Guru
posted Hide Post
you are using the same name for 3 different fields.

Try changing the field names to STR1, STR2,STR3 etc.
Use the GETTOK on the correct field
STR2/A100 = GETTOK(STR, 2000, 1, '€', 100, STR2);
STR3/A100 = GETTOK(STR, 2000, 2, '€', 100, STR3); and so on.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Member
posted Hide Post
sorry for that typo

here are the commands

STR2/A100 = GETTOK(STR1, 2000, 1, '€', 100, STR2);
STR3/A100 = GETTOK(STR1, 2000, 2, '€', 100, STR3);


and the results

str2 (same as the original string)


Y€€€Henry Ford College€5105 Evergreen Rd.€Dearborn, MI 48128€KJ C€N€€€€€€€Y€Y€N€€€€€R€002270€G02270€€2015€Y€N€RýD€TG52132€SU/SP€FXSU/SP€FA/WI€2012ý2013ý2014€€ATTNPTTN€UG€CR€NONAUDIT€FQREGCR1ýFXSTATUSýFQNOATT€2€HS€MAIN€002270€002270€32574048€€€€00227000€€kjc@hfcc.edu€(313) 845-9616€€€€€DEFAULT€(313) 845-9825€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€100€€Y€3€€32574048€32574048€32574048€€P€RA€RA€32574048€N€2€2€€4€2€4€4€4€Y€Y€FADL€H€H€PREFERRED€CA€MX€US€€ISIM.PERSON€€Y€€€€€Y€€€€€2€€€€€€Y%


and string3

Y€€€Henry Ford College€5105 Evergreen Rd.€Dearborn, MI 48128€KJC€N€€€€€€€Y€Y€N€€€€€R€00

100 characters (- name removed for show & tell)

ignores the euro sign


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Member
posted Hide Post
above
str1 is the original
str2 in the result of the first gettok and
str3 is empty the resuilt of the second gettok


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Virtuoso
posted Hide Post
It appears the € symbol is being used both as a delimiter and as filler. GETTOK is probably confused by finding many delimiters in a row. You could try something like this:

1. Use STRREP to replace all spaces with some character you know will never appear in the data ($,~,#,%,^,*, etc.)
2. Use STRREP to replace all € with a space.
3. Use SQUEEZ to compress all occurrences of multiple spaces into one space.
4. Use STRREP to replace all spaces with €.
5. Use STRREP to replace the character you chose for step 1 with a space.
6. You should now be able to use GETTOK to parse the string using € as the delimiter because all multiple occurrences of € should have been reduced to a single one.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
I'm starting to think that the problem is somehow with the character set. The euro symbol is a decimal 128 in the data string. (I copied and pasted the euro symbol from the data string into my report code).
Problem is, if I go into code and hold [alt] down and type 128 on the keypad I get a different character than the euro sign.(it looks like the euro sign is not part of the character set we are using - I tried all 255, and got no euro sign). Is it possible to change the character set somewhere?


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Master
posted Hide Post
I might be missing something, but I threw this together and it worked fine..

-SET &STRIN = 'Y€€€Henry Ford College€5105 Evergreen Rd.€Dearborn, MI 48128€KJ C€N€€€€€€€Y€Y€N€€€€€R€002270€G02270€€2015€Y€N€RýD€TG52132€SU/SP€FXSU/SP€FA/WI€2012ý2013ý2014€€ATTNPTTN€UG€CR€NONAUDIT€FQREGCR1ýFXSTATUSýFQNOATT€2€HS€MAIN€002270€002270€32574048€€€€00227000€€kjc@hfcc.edu€(313) 845-9616€€€€€DEFAULT€(313) 845-9825€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€100€€Y€3€€32574048€32574048€32574048€€P€RA€RA€32574048€N€2€2€€4€2€4€4€4€Y€Y€FADL€H€H€PREFERRED€CA€MX€US€€ISIM.PERSON€€Y€€€€€Y€€€€€2€€€€€€Y%' ; 
-SET &SEP = '€';
-SET &STROUT = STRREP (&STRIN.LENGTH, &STRIN, &STRIN.LENGTH, &SEP, 1, '$', &STRIN.LENGTH, 'A&STRIN.LENGTH');

-TYPE STRIN - &STRIN 
-TYPE STROUT - &STROUT 



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Virtuoso
posted Hide Post
Have you tried using the BYTVAL function to get the decimal equivalent?

-SET &ASCII_CODE = BYTVAL('€','I3');
-TYPE &ASCII_CODE


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
I might try the byteval solution.

what worked is this:
TESTCHAR/A1 = EDIT(STR1,'$9');
STR/A2000 = STRREP(2000, STR1, 1, TESTCHAR, 1, '*', 2000, STR);

a cheesy way of doing things, but the first field is y/n and I know the second character will always be the euro sign.
Why the command works with the character extracted from the string itself but not by comparing decimal equivalents is a mystery


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Member
posted Hide Post
Gavint

I tried your solution, and if I just type that in, it works for me too. Same thing with real data fails.

go figure


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report 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     [CLOSED] GETTOK CTRAN and STRREP

Copyright © 1996-2020 Information Builders