× 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.



Try pos = %scan (%trim(NEWORD) : CMNAME);

On Wed, Sep 23, 2020 at 7:00 PM Danner, Duane <ddanner@xxxxxxxxxxxx> wrote:

I have a input field called NAME and this field can be up to 30
characters. I want to get rid of preceding blanks and post blanks. If the
name BROTHERS is entered I only want 'BROTHERS' not 'BROTHERS
'

Then I want to scan a field name in a field CMNAME for 'BROTHERS' in a
value that could be 'JONES BROTHERS '

C *IN54 DOWEQ '0'
C CUSKEY READE CUSMST 54
*
C *IN54 IFEQ '0'

C MOVE *BLANKS NEWORD1
C EVAL NEWORD1 = %Trim(NEWORD)

/FREE

pos = %scan (NEWORD1 : CMNAME);
substring=%subst (CMNAME:1:pos);
DSPLY substring;

/END-FREE
C POS IFNE 0
C WRITE ITM
C ENDIF
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.