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] Simple Trim Function help

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Simple Trim Function help
 Login/Join
 
Master
posted
I'd like to trim space characters from the beginning and end of a variable. I looked over the documentation for TRIM and I'm not sure what I'm doing wrong. This is the first time I've tried to use the TRIM function. See below...

-DEFAULT &INJK = ' KLAUS ';
-SET &INJK2 = TRIM('B',&INJK,&INJK.LENGTH,' ',1,'A&INJK.LENGTH');

The value and length of the INJK2 variable is the exact same as the INJK variable. The TRIM function as I put it in isn't doing anything at all!

Any ideas on what I missed?

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


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Master
posted Hide Post
Yes...

The last argument is the output length.
You tell it to be INJK.LENGTH in length.

What happens is ( I use · as space marker in this sample )

You start with a probably German guy named:
·KLAUS·

You end up with KLAUS
And then you put it in a 7 char long variable. Extra room is filled with spaces:
KLAUS··


That's what is happening...


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Expert
posted Hide Post
One possibility - left-justify, then truncate:

-SET &TEST1 = '      FRANCIS     ';
-SET &TEST2 = LJUST(&TEST1.LENGTH, &TEST1, 'A&TEST1.LENGTH');

-SET &TEST3 = TRUNCATE(&TEST2);

-TYPE &TEST1 &TEST1.LENGTH
-TYPE &TEST2 &TEST2.LENGTH
-TYPE &TEST3 &TEST3.LENGTH


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
Master
posted Hide Post
Thanks Francis! Works great now!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report 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] Simple Trim Function help

Copyright © 1996-2020 Information Builders