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



Pete

You could always do a RGZPFM based on the index in a logical file. If you are not using SMP, you would probably get it in that order, the physical order of the PF. But still no guaranteed unless you ask for it.

Vern

-------------- Original message --------------
From: Pete Helgren <Pete@xxxxxxxxxx>

I just thought the file would have a "natural" order for sorting
specified by the DDS. I am not sure why I thought that the index
followed the sequence that the keys were specified in the DDS. "Urban
legend" I guess...

Pete


Charles Wilt wrote:
The only way to guarantee you'll get the data back in a given order is
to use the ORDER BY clause to specify the order you want.

Think about it, you've said you wanted all records, and don't care
about the order. The quickest way to give you that is to sequentially
read the data right from the physical.

Why would the DB do extra work?

HTH,

Charles

On Thu, Aug 21, 2008 at 4:43 PM, Pete Helgren wrote:

I thought I understood this but apparently I don't.

I have a physical and logical file with the following specs:

UNIQUE
R FASA809 TEXT('List Workfile')
-------------------------------------------------------
record layout here:
SLWID 6S 0 COLHDG('Absence ID')
SLW# 6S 0 COLHDG('Seq. Number')
SLWSN 9S 0 COLHDG('Sub SSN')

K SLWID
K SLW#

The logical file looks like:

UNIQUE
R FASA809 PFILE(PASA809)

K SLWID
K SLWSN


The physical file has a randomly generated number in field SLW# and
since the keys are SLWID and then SLW# in that order. I would expect the
file to be ordered that way when I open it up in Query or a simple
select with no ordering in SQL. However, the file is always ordered in
arrival sequence. If I read through this file, I see the records in the
order in which they were written in the file. I *expected* them to be
ordered by the key sequence.

What did I miss or misunderstand?

Thanks

Pete

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.