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



To confirm - it seems you want to replace a blank field with a comma - no matter the number of blanks?

So the commas are NOT separators between the fields? Not really? Some of the solutions proffered COULD do the job with separators, unless you had 3 consecutive fields with blanks.

I tested Kevin's idea and got an extra comma where the 2 blanks fields are.

I think a procedure (call it compress) could work - one parameter, defined the same as the fields are, or adequate to handle the fields. It would return a value defined like the fields. The body of the code could basically be this -

returnvalue = parameter;

if parameter = *blanks;
   returnvalue = ',';
endif;

return returnvalue;

Then your concatenation would be newvar = compress(var1) + compress(var2) + ... + compress(var6);

Hide the ugliness in a procedure - keeps it looking nice on the outside.

Maybe?
Vern

On 1/14/2020 10:40 AM, MichaelLange@xxxxxxxxxx wrote:
The commas are actually there to represent the blank fields.

Need to show which fields have values as these represent surface coatings.

Regards
Michael Lange
Loewen Windows
Steinbach, MB
204.326.6808 ext. 5148



From: "Alan Shore via RPG400-L" <rpg400-l@xxxxxxxxxxxxxxxxxx>
To: "RPG programming on IBM i" <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: "Alan Shore" <ashore@xxxxxxxx>
Date: 01/14/2020 10:34 AM
Subject: RE: [EXTERNAL] Field concatenation
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>



Hi Michael
What do you want to see if 2 (or more) contiguous field have a value of
other than blank?
Do you STILL want to separate the fields by comma's?

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
MichaelLange@xxxxxxxxxx
Sent: Tuesday, January 14, 2020 11:26 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: [EXTERNAL] Field concatenation


V7.2

Hoping there is an easier way of doing this than creating a very ugly IF
run.

I have 6 text fields which may or may not all contain values.
example:
V1 = blank
V2 = 0.022
V3 = blank
V4 = blank
V5 = 0.022
V6 = blank.

What I want to create is a field like ',0.022,,0.022,' where commas are the
blank fields.

Regards
Michael LangeThis e-mail message, including any attachments, is for the
sole use of the person to whom it has been sent, and may contain
information that is confidential or legally protected. If you are not the
intended recipient or have received this message in error, you are not
authorized to copy, distribute, or otherwise use this message or its
attachments. Please notify the sender immediately by return e-mail and
permanently delete this message and any attachments. Loewen makes no
warranty that this e-mail is error or virus free.
Please think green before printing this email.
--
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 e-mail message, including any attachments, is for the sole use of the person to whom it has been sent, and may contain information that is confidential or legally protected. If you are not the intended recipient or have received this message in error, you are not authorized to copy, distribute, or otherwise use this message or its attachments. Please notify the sender immediately by return e-mail and permanently delete this message and any attachments. Loewen makes no warranty that this e-mail is error or virus free.
Please think green before printing this email.


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.