Thanks for all the suggestion guys, we discovered that more "sorting" is
required than what we might have thought initially, we are going to look at
other approaches to doing this. (This is what happens when you are
converting an excel spreadsheet to a report, I guess).

-----Original Message-----
From: Dennis Lovelady [mailto:dlovelady@dtcc.com]
Sent: Friday, November 09, 2001 1:12 PM
To: midrange-l@midrange.com
Subject: Re: Custom sort in a logical???



Hi, Rob:

I don't understand why you say a translate table won't work.  Of course, I
don't know enough about the data...  but if Group is a single-byte field,
xlate table is the way to go, seems to me.

Dennis






rob@dekko.com@midrange.com on 11/09/2001 01:59:48 PM

Please respond to midrange-l@midrange.com

Sent by:  midrange-l-admin@midrange.com


To:   midrange-l@midrange.com
cc:
Subject:  Re: Custom sort in a logical???



I don't think a translation table will work.  Unless your translation table
converts Group 7 into Group 1 and Group 9 into Group 6, and leaves the rest
of the groups alone.

I haven't found a solution but I tried the following:
SELECT iclas FROM iim GROUP BY iclas
and got:
Itm
Cls
01
02
05
10
...

So then I tried
SELECT
 case iclas
 when '01' then '02'
 else iclas
 end
from iim
group by iclas
and got
CASE expression
      02
      02
      05
      10
...
Which looks good except there are two '02'.  So then I tried
SELECT
 case iclas
 when '01' then '02'
 else iclas
 end
from iim
group by 1
and got:
Column ICLAS or expression specified in SELECT list not valid.

But if you don't need the GROUP but a simple ORDER will work try:
SELECT
 case iclas
 when '01' then '02'
 else iclas
 end
from iim
order by 1

To create the view, or logical file:
CREATE VIEW ROB/deleteme
(ICLAS, IPROD) AS
  SELECT
   case iclas
   when '01' then '02'
   else iclas
  END,
  iprod
from iim

Then to test this new view:
select iclas
 from rob/deleteme
 group by iclas
will give you:
ICLAS
 02
 05
 10
...


Rob Berendt

==================
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



                    "Wills, Mike N.
                    (TC)"                     To:
"'midrange-l@midrange.com'" <midrange-l@midrange.com>
                    <MNWills@taylorcorp       cc:
                    .com>                     Fax to:
                    Sent by:                  Subject:     Custom sort in a
logical???
                    midrange-l-admin@mi
                    drange.com


                    11/09/2001 12:39 PM
                    Please respond to
                    midrange-l






Is it possible to do a custom sort order in a logical, if so how is this
done? I need to group some things together differently than how it was set
up. For example: I want Group 1 and 7 together and Group 6 and 9 together
for easy processing. The rest then get sorted as normal after that.

TIA,

Mike
_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
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 ...


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.