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



OK must have missed that note. In that case the solution is pretty trivial - so why have we all spent so long discussing it ? <grin>



On Jan 14, 2020, at 3:56 PM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx> wrote:

Ah how we love clear specifications!

Somewhere in the thread, Michael said, in effect, that he wanted to replace each blank value with a comma - so the triple-comma value is the desired result.

At least that's what I kind of remember!

Cheers
Vern

On 1/14/2020 2:41 PM, Jon Paris wrote:
Right - so 12345 blank blank blank 23456 will result in 12345,,,23456

But that is not what the OP wanted I believe - he wanted the result to be 12345,23456 i.e. no matter how many blank fields only one comma.

Which is why I responded as I did to Vern

On Jan 14, 2020, at 2:31 PM, Francois Lavoie <Francois.Lavoie@xxxxxxxxxxxxxxxxxxxx> wrote:

Yup Mr Paris. I tried it

Any blank vars will be replaced by a single comma

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jon Paris
Sent: Tuesday, January 14, 2020 14:30
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Field concatenation

Nope.


On Jan 14, 2020, at 2:04 PM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx> wrote:

Will it handle 3 blank contiguous fields?

On 1/14/2020 12:41 PM, Francois Lavoie wrote:
This will solve the 2 consecutive blank fields being replace by only 1 comma:
Str=%ScanRpl(' ':',':V1+V2+V3+V4+V5+V6);
^ 5 spaces

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Barbara Morris
Sent: Tuesday, January 14, 2020 13:20
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Field concatenation

On 2020-01-14 12:07 p.m., Francois Lavoie wrote:
I think if 2 consecutive vars are blanks it will be replaced by only
1 comma, not what you want

I think this was already mentioned, but if the v1 v2 etc aren't trimmed, they would be replaced by several commas for each vN field. If the values are trimmed, then an all-blank value wouldn't be replaced by any commas.

I don't think there's any way to avoid either doing all the IFs or
(better) writing a procedure.

--
Barbara

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post
a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx 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 RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx 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 RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx 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 RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx 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 RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx 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-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.