× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 26-Jan-2012 15:21 , Monnier, Gary wrote:
And, you can throw a trim() in there as well.

Select * from qtemp/myfile
where field100 not like '%' concat trim(field5) concat '%'

CRPence on Thursday, January 26, 2012 3:12 PM wrote:
<<SNIP>>

Select * from qtemp/myfile /* rtrim(field5) maybe instead? */
where field100 not like '%' concat strip(field5) concat '%'
; -- report from above SELECT:
....+....1....+....2....+....3....+....4
FIELD5 FIELD100
setup Setup the system to generate alerts
******** End of data ********
;

<<SNIP>>



/A distinction without a difference/ I believe.

If leading blanks in FIELD5 [as character string data] have significance, then likely the desired scalar is RTRIM versus TRIM [when written in the form TRIM(expression)]. The latter defaults to trimming both the leading and trailing default strip-character [of blank or 0x00 aka x'00'], according to the attributes of the expression. Although not very conspicuous, the second SELECT example had mentioned [inside of comment delimiters] that the RTRIM may be more desirable choice than STRIP; most likely the RTRIM would be preferred over STRIP, so I probably should have switched the two.

FWiW, the documentation for the SQL scalar functions, suggests that "The STRIP function is identical to the TRIM scalar function. For more information, see TRIM." Also that "The RTRIM function returns the same results as: STRIP(expression,TRAILING)" and that should be the same as TRIM(T FROM expression).
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/db2/rbafzmstscale.htm

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.