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



Yes the most efficient foolproof way would to use embedded SQL and the trim function on the sysibm.dummy file (or whatever it is)

If not clear from this I can forward exact code I’ve used for this tomorrow

Please advise if so….

Sent from my iPhone

On 22 Dec 2022, at 22:59, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

Until you get a string that contains two valid spaces!

You should be able to nest the TRIM function into the STRING operation. Haven't time to play with it but it should work.


Jon P.

On Dec 22, 2022, at 1:58 PM, Rich Loeber <rich@xxxxxxxxx> wrote:

Mark,

I tried the option with 2 spaces as the delimiter and it seems to produce the result that I'm looking for.

Thanks!

Rich

________________________________


On 12/22/2022 1:36 PM, Mark Waterbury wrote:

Try: STRING SRC-STRING DELIMITED BY ' ' INTO TGT-STRING
END-STRING

On Thursday, December 22, 2022 at 01:25:52 PM EST, Rich Loeber <rich@xxxxxxxxx><mailto:rich@xxxxxxxxx> wrote:

I use the STRING command quite often and I've run into an issue. I normally do STRING delimited by SIZE which uses the defined field length when gluing fields together. What I'd really like to do in one application is have it delimited by the size of the field contents. For example, I have a 200 character field but it often only has the first 6 characters for content. I would like to the STRING command to only copy those 6 characters and not the other 194 blanks.

Any suggestions?

Rich Loeber
Kisco Systems LLC
https://www.kisco.com

________________________________


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.


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