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



Alan,

I don't kow if the recursive options that appeared with V5R4 would help with
your case (unfortunatly, we are stuck here at V5R3). Using older releases, I
think something likes this (rough idea) could work :

---------------
With t1 as (
SELECT (Case
When (field1 || field2 || field3) <> ' '
THEN '00001'
ELSE KEY
END )
AS Group_field
, a.*
FROM myTable a
)
Select Group_field, sum_or_whatever_you_need
FROM t1
Group by Group_Field
;

---------------

HTH,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Thu, Jul 21, 2011 at 12:07 PM, Alan Shore <ashore@xxxxxxxx> wrote:

Good afternoon all
I'm not too sure if the subject line truly describes my predicament, so
here goes
I've been working on this for the past couple of days without success, so I
am hoping someone has an answer to my problem
I have a file that contains (among other things) 21 occurrences of the same
size field that can contain similar data
For example

Key field1 field2
field3 field4 field5
field6 field7 etc.-->
00001 360 160
202 400 118
00002 160
00003 400 202
600
00004 160 118
00005 202
00006 400
00007 111

Using record key 00001 as a starting point, I need to group all records
that have any of the non- blank values in any of the occurrences, EXCLUDING
those records that have OTHER none blank values
Using the above example
Keys 00002, 00004, 00005, 00006 would be grouped with 00001
Key 00003 would not (value 600 NOT in Key 00001)
Key 00007 would not (value 111 NOT in Key 00001)

Hopefully, what I am asking makes sense, AND is feasible
As always, any and all suggestions are welcome


Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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-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.