Order by with select if in PHWeb

Rick Hill rmhill@core.com
Fri, 30 May 2003 10:20:30 -0400


I think the following could allow the screen to be used for updates to 
the file that is missing the ideal index:

Make sure the new, temporary indexed file contains the fields that are 
the segments of the primary index of the Primary file (step 5 below in 
Chuck's response would need LETs for each of those fields).  As Chuck 
said, make the file ("REAL_FILE") we are wanting to update a DESIGNER 
file.  Then in a POSTUPDATE procedure, update that file with something 
like this:

PROCEDURE POSTUPDATE
BEGIN
  FOR TEMP_FILE
  BEGIN
    GET REAL_FILE VIA THE_INDEX USING FIELD_A, FIELD_B,... OF TEMP_FILE
    LET FIELD_C OF REAL_FILE = FIELD_C OF TEMP_FILE
    LET FIELD_D OF REAL_FILE = FIELD_D OF TEMP_FILE
     ...  
    PUT REAL_FILE reset
  END
END


Hope this helps!

Rick Hill

> But this would only work if the file was read only.  What if the 
primary
> record needs to be updated?
> 
> Blue
> 
> -----Original Message-----
> From: chuck.reinke [mailto:chuck.reinke@sbcglobal.net]
> Sent: Friday, May 30, 2003 9:54 AM
> To: powerh-l@lists.swau.edu
> Subject: Re: Order by with select if in PHWeb
> 
> 
> 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
> 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> 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.
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> 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.
> 

-- 
CoreComm Webmail. 
http://home.core.com