×

Good News Everybody!

The new search engine is LIVE!

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




Can you define "trim out"?

If you mean delete trailing blanks, I'm not sure how you're going to
keep them off. CL variables are fixed-length so even using CL's built-in
trimming operators will only give you back a field with blanks it in.
If you need it in a string expression then using something like this:

  DCL  &MyVar  *CHAR 12  Value('New Baby    ')

  CHGVAR VAR(&Var2) VALUE(&MYVAR *TCAT '?')

That would be a question mark after the last non-blank character in the
original field.

Not sure what else you need.

Bob

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On Behalf Of Wills, Mike N. (TC)
Sent: Tuesday, December 10, 2002 1:59 PM
To: 'rpg400-l@midrange.com'
Subject: Trimming in CL


I need to be able to trim out the spaces of a field in a CL program. Is
there a way to do this? Or will it be best to use an RPG program?


Mike Wills
iSeries Programmer
mnwills@taylorcorp.com
(507) 386-3187
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@midrange.com To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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