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.
Now I want to remove trailing spaces. I tried to do RTRIM(TRIM( 'L', IDOCNUMBER, 50, '0', 1, 'A50' )) or TRIM(TRIM( 'L', IDOCNUMBER, 50, '0', 1, 'A50' )) since the default is spaces, but nothing worked This message has been edited. Last edited by: Kerry,
Are there really trailing spaces, or is this a 50 character field? Wouldn't there always be 50 characters in a 50 character field? To determine the length of the non-blank part of a field, use the ARGLEN function.
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
This will remove trailing spaces, but if you put the resulting string back into an A50 field, it will be padded with spaces/blanks to fill out the 50 characters:
TRIM('R',IDOCNUMBER,50,' ',1,'A50')
You could try putting the TRIMmed value into a variable length field:
TRIM('R',IDOCNUMBER,50,' ',1,'A50V')
Or, if writing the value to a HOLD file, you could specify the exact, non-blank length by using function ARGLEN as suggested by Francis:
DEFINE FILE <filename>
OUTLENGTH/I5 = ARGLEN(50,IDOCNUMBER,'I5');
OUTFORMAT/A10 = 'A' | EDIT(OUTLENGTH);
END
TABLE FILE <filename?
PRINT IDOCNUMBER/OUTFORMAT
.
ON TABLE HOLD
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
You can use TRIM to remove leading zeroes, but Francis' earlier comment is valid: you shouldn't need to remove trailing blanks because DataMigrator should automatically take care of truncating data from your source column when loading it into a smaller target column.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007