×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Or make NEWORD1 varying (I'm assuming it is not). Otherwise it is still
trying to do the %scan with spaces at the end as in 'BROTHERS '.

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vinay
Gavankar
Sent: Wednesday, September 23, 2020 7:26 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Have an issue with %trim

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

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

Replies:

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

This mailing list archive is Copyright 1997-2026 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.