Order by with select if in PHWeb

chuck.reinke chuck.reinke@sbcglobal.net
Fri, 30 May 2003 07:54:03 -0700


The Subfile technique should work, here is another suggestion of an
approach:

The major challenge is efficiency.

1 - In the Dictionary, declare an indexed file , indexed by the sort item.
2 - Construct an FDL to efficiently index this file.
3 - In the PostPath, do a WhileRetrieving on your current Primary file,
include a Select clause with it, but make it a Designer File.

4. At the beginning of the PostPath, create the file with and FDL command
statement
5. During the WhileRetrieving, do Puts (don't for get the Reset verb) to
this previously non-existent file
6. Access this file ViaIndex of the sort item (you don't need a select
anymore)
7. In the Exit procedure, purge the file. You may wish to lock and unlock it
as well.

I don't have a VMS system to try this out, but I've done it before with KSAM
on an HP, and the technique is remarkably fast.

Chuck