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] getting error while using GETTOK function

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] getting error while using GETTOK function
 Login/Join
 
Member
posted
Hi
I am using GETTOK function to extract a subsrting. Below is the code which i used.
 
-SET &GROUPING='Grouping_1|Grouping_2';
-SET &SORTING='Sorting_1~LOWEST|Sorting_2~HIGHEST';
-SET &SUMMING='Summing_1|Summing_2';
-SET &GROUPPBY_1=GETTOK(&GROUPING, 40, 1, '|',20,'GROUPBY_1');
-SET &GROUPPBY_2=GETTOK(&GROUPING, 40, 2, '|',20,'GROUPBY_2');
-SET &SORTBY_1=GETTOK(&SORTING, 50, 1, '|',20,'SORTBY_1');
-SET &SORTBY_11=GETTOK(&SORTBY_1, 50, 1, '~',20,'SORTBY_11');
-SET &SORTBY_12=GETTOK(&SORTBY_1, 50, -1, '~',20,'SORTBY_12');
-SET &SUMBY = CTRAN(100,&SUMMING,124,32,SUMBY);

-TYPE SUMBY : &SUMBY
-TYPE GROUPPBY_1 :&GROUPPBY_1
-TYPE GROUPPBY_2 :&GROUPPBY_2
-TYPE SORTBY_1 :&SORTBY_1
-TYPE SORTBY_11 :&SORTBY_11
-TYPE SORTBY_12 :&SORTBY_12


The &GROUPING,&SORTING and &SUMMING are passed in the URL. The length of the variables varies depending upon the user input.

When I execute this code im getting some junk values, and some values are getting truncated as shown below.

SUMBY : Summing_1 Summing
GROUPPBY_1 :Grouping_1
GROUPPBY_2 :Grouping_2 ˜m
SORTBY_1 :Sorting_1~LOWEST
SORTBY_11 :Sorting_1
SORTBY_12 :LOWEST šm

I am not able to understand why this occurs. Please help to resolve this issue.
Thanks.

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


WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV
 
Posts: 25 | Location: Chennai | Registered: August 27, 2008Report This Post
<JG>
posted
When using functions in -SET statements the target cannot be a column name.
It MUST be a format for example

-SET &GROUPPBY_1=GETTOK(&GROUPING, 40, 1, '|',20,'A20');

NOT

-SET &GROUPPBY_1=GETTOK(&GROUPING, 40, 1, '|',20,'GROUPBY_1');

This applies to all functions. Also note it must have the quotes around the format,
look at your CTRAN that should be 'A32' NOT SUMBY
 
Report This Post
Expert
posted Hide Post
Also bear in mind that the second parameter in GETTOK is the incoming length and you are specifying a fixed length of 40 but state that they are variable in length.

So instead of -
-SET &GROUPPBY_1=GETTOK(&GROUPING, 40, 1, '|',20,'A20');

use -
-SET &GROUPPBY_1=GETTOK(&GROUPING, &GROUPING.LENGTH, 1, '|',20,'A20');

I would also stay clear of using a pipe "|" character for demlimitation of values as who knows how WF might treat it in future! I would stick with semi colons ";" instead.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Thanks for your comments JG and Tony.

I changed the target values and also used the LENGTH function.Its working fine now.

Thanks.


WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV
 
Posts: 25 | Location: Chennai | Registered: August 27, 2008Report 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] getting error while using GETTOK function

Copyright © 1996-2020 Information Builders