Order by with select if in PHWeb

Hoppe, Eric EP Eric.Hoppe@steelscape-inc.com
Fri, 30 May 2003 08:54:32 -0700


Etienne-

I have only been casually reading your thread, so if this solution is
off-base I apologize.  At first your question was about sorting in Quiz but
this message refers to Quick?  I can't quickly find the previous thread, but
I sent a bunch of code snippets to someone a while ago pertaining to our
extensive use of special RMS sorting files.

We are OpenVMS (fortunately). We have an indexed record called SORTFILE with
a single 100 char field.  The field is a repeating primary ascending key.
    Record:             SORTFILE
    of File:            SORTFILE
    Organization:       INDEXED
    Type:               RMS
    Open:               SORTFILE
    Record Format:      Fixed
    Supersede:          No

    Record Size:        100 Bytes

-- Record Contents --
    Item                                 Type            Size  Occ  Offset
    KY-SORTFILE                          CHARACTER        100            0

-- Index Contents --

 ** KY-SORTFILE is a 100 byte REPEATING PRIMARY ASCENDING  index **

    Segment                              Type            Size
    KY-SORTFILE                          CHARACTER        100


SORTFILE is populated however we want so as to properly sort the data.  For
instance, names will sort: Adam, Bruno, Charley, David.  But lets say we
want to sort on the names of the cars they drive which is not an indexed
key: Ford, Chevy, Dodge, GM (respectively).  So, as we loop through the
records, we 'put' to an empty SORTFILE with the car type first.  After the
put, the populated file will look something like:
	Ford   Adam
	Chevy  Bruno
	Dodge  Charley
	GM     David

Now when you do a WHILE RETRIEVING on SORTFILE, the data is returned in the
order you want... by car.

There is a bit of tricky code to create uniquely defined files so every user
is pointed to their own sortfile in the case it is being used concurrently.
I can send sample code to you if this is what you want.

---ehops
Eric Hoppe
Senior System Analyst
Steelscape
Kalama, Washington, USA
(360) 673-8247

-----Original Message-----
From: Markus Grossrieder [mailto:markus.grossrieder@alba-systems.com] 
Sent: Friday, May 30, 2003 4:35 AM
To: Etienne Rompré
Cc: Powerhouse List
Subject: Re: Order by with select if in PHWeb


Etienne,

> The field I want to sort on is not indexed.  Any workaround 
> possible???

Besides modifying the dictionnary ? You could generate a subfile (before
launching Quick, or from inside) in the desired order and use this subfile
as your primary, with all the restrictions using subfiles in Quick.

HTH, regards,
Markus

----- Original Message ----- 
From: "Etienne Rompré" <rompre@kangouroute.com>
To: "Edis, Robert" <Robert.Edis@blistex.com>
Cc: "Powerhouse List" <powerh-l@lists.swau.edu>
Sent: Wednesday, May 28, 2003 7:48 PM
Subject: Re: Order by with select if in PHWeb


> HI Robert,
>
> The code sample is :
>
> FILE FKAFCES PRI
>
> SELECT IF ECIE_NUME OF FKAFCES = NUME_ECIE AND &
>
> EAJU_NUME OF FKAFCES = NUME_AJUS AND &
>
> (ECES_STAT OF FKAFCES = "R" OR ECES_STAT OF FKAFCES = "")
>
>
> The field I want to sort on is not indexed.  Any workaround 
> possible???
>
> Thanks!
>
>
> --
> Etienne Rompré
> Directeur Marketing - Technologies
> Marketing - Technologies Director
>
> Kangouroute Inc.
> Location autos - camions
> Car & Truck Rental
> Québec Canada
>
> tél: (418) 266-9500
> fax: (418) 683-2610
> courriel/email: rompre@kangouroute.com
> internet:  http://www.kangouroute.com/
>
>
>
>
> > G'day Etienne
> >
> > Are you saying that:
> >
> > ACCESS ... ORDER BY ...
> > SELECT IF ...
> >
> > doesn't work for you?
> >
> > Can we a sample of your code please?
> >
> > Blue
> >
> > PS.  What are kangaroos doing renting cars in Québec?
> >
> > -----Original Message-----
> > From: Etienne Rompré [mailto:rompre@kangouroute.com]
> > Sent: Wednesday, May 28, 2003 12:22 PM
> > To: Powerhouse List
> > Subject: Order by with select if in PHWeb
> >
> >
> > HI,
> >
> > OpenVMS 7.3
> > Powerhouse 8.30z1
> > Powerhouse Web 2.30z1
> >
> > Is there a way to make an «order by» on my primary file in PhWEB 
> > after I made a »select if» on the same primary file?
> >
> > Thanks!
> >
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = Mailing list: 
> powerh-l@lists.swau.edu
> Subscribe: "subscribe" in message body to 
> powerh-l-request@lists.swau.edu
> Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
> http://lists.swau.edu/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a 
> subscriber.
>
>