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     LCWORD hoses Concatenation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
LCWORD hoses Concatenation
 Login/Join
 
Virtuoso
posted
I have reports running where I have to combine a first and last name after converting case, and LCWORD seems completely determined to not allow me to remove trailing blanks from the first name. The basic code:

Counselor_Name/A60=LCWORD(15, FIRST_NAME, 'A15') || ' ' | LCWORD(24, LAST_NAME, 'A24');

Looks very pretty in html, as html removes the extra spaces as a courtesy (or curse depending on your needs). In pdf the blanks on the end of the first name magically return.

I've twisted this about two-dozen ways, via ARGLEN and SUBSTR and the like, breaking it into pieces, but to no avail. If someone has made LCWORD and Strong Concatenation work together I would very much appreciate a reply.

Please -- I am not a rookie, and I have worked this. Reply if you have proven, in-production code only.


Remarkable that this bug has not been reported and fixed after 25 years of FOCUS.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
John,

We are aware that you are not a rookie, but it would be nice to know what platform and release you are using so that we can check on the same before we reply Smiler. Please update your signature?

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
Virtuoso
posted Hide Post
7.6 on Wintel. I will update my profile now, although each of my customers is using something different (sigh).



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Master
posted Hide Post
LCWORD(15, FIRST_NAME, 'A15') || ( ' ' | LCWORD(24, LAST_NAME, 'A24')) ;

Remember that wf evaluates left to right so it
does (without the brackets)

res1 = Hard Concat first name and blank
Soft Concat res1 and last name.

Bracketting changes the order

Or better still try Tony's solution...

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



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Expert
posted Hide Post
Such are the trials of life Wink

As for a solution try the concatenation first and then perform the LCWORD topped off with the SQUEEZ function -
Counselor_Name/A60=SQUEEZ(40, LCWORD(40, (FIRST_NAME || (' ' | LAST_NAME)), 'A40'), 'A40');

Or better still try John's solution ...

T

This message has been edited. Last edited by: Tony A,



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
Virtuoso
posted Hide Post
quote:
Originally posted by hammo1j:
LCWORD(15, FIRST_NAME, 'A15') || ( ' ' | LCWORD(24, LAST_NAME, 'A24')) ;

Remember that wf evaluates left to right so it
does (without the brackets)

res1 = Hard Concat first name and blank
Soft Concat res1 and last name.

Bracketting changes the order


Although this is completely counter-intuitive to me (the failing concat does not change its ordering), it works perfectly. Thanks!



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Guru
posted Hide Post
As they say, there's more than one way to skin a cat.

Here's mine.

NAME/A50 = LCWORD(50, SQUEEZ(50, FNAME|LNAME, 'A50'), 'A50');


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
John, I usually do the LCWORD after the concatentations on the whold field and it seems to work fine. Of course on names it can be tricky if they are MacGuyver for example do you allow for that?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Guru
posted Hide Post
Good thought Leah. That really does make one have to step back and rethink out the solution.

I really do love the FOCAL POINT "Think Tank".


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
I've instructed the customer to fire all Scotsmen.

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



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
It's not only the Scots that have apostrophes in their surnames Wink



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
Guru
posted Hide Post
Remember that strong concatenation (||) doesn't remove the blanks. It just moves them. The brackets make a single unit out of the last two elements so that the blanks at the end of the first name can be moved after them.

If you don't put the brackets in it will move them after the space you are inserting between the first and last names. It's not failing. It's doing exactly what you asked it to.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
"Remember that strong concatenation (||) doesn't remove the blanks. It just moves them."

It is my greatest hope and that you just made this up to be humorous.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Guru
posted Hide Post
I was an Information Builders Instructor in FOCUS and WebFOCUS for many years. The biggest misconception about strong concatenation is that it strips out blanks. Consider the following:

A || B
If A has trailing blanks they are moved to the end of B.

A || B | C
The expression is evaluated from left to right. If A has trailing blanks they are still moved to after B, the object on the right side of the strong concatenation symbol.

A || (B | C)
The object 'B | C' is evaluated first because of the brackets. It is now the object that is on the right side of the strong concatenation symbol so the trailing blanks from A are moved all the way to the end.

It was much more evident in the fixed fonts of the mainframe than it is with html output. Test it out with a COURIER font in PDF and it will become more clear.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Master
posted Hide Post
John_Edwards, sorry but Piipster is exactly correct.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
This may be because the 102 course uses the language "remove the trailing blanks" in several locations.

But in the help files in Dev Studio it does indeed say that they are moved to the end of the string. See? You learn something new every day.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 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     LCWORD hoses Concatenation

Copyright © 1996-2020 Information Builders