For Missing Question
Michael Lee
Michael.Lee@mclsystemsinc.com
Thu, 09 Nov 2000 07:29:22 -0800
Hi Terry,
You've got a bit of a kluge there and I can see why it might have problems. I
think what you really want is something that works. I played with it this
morning and came up with something that should work. It will be slower than
your example but it will work.
In my example I'm using two files. The SHIP file contains many occurrences of
CUST_ID, which is unique to CUST. It should be easy to translate my example to
yours (as I did from yours to mine).
scr xxx
temp t_CUST_ID char*8 reset at mode ;<-- note the 'reset at mode'
file ship occurs 3
select if cust_id of ship <> t_CUST_ID ;<-- important
file cust secondary occ with ship
skip 2
clust occ with ship
field cust_id of ship
field ship_code of ship
field cust_parent_id of cust
field cust_create_date of cust
clust
proc path
begin
let path = 1
end
proc find
begin
for ship
begin
if path = 1
then get ship via cust_id using '@'
get cust opt ;<-- you can remove the 'opt' if required
let t_CUST_ID = CUST_ID of SHIP
end
end
I hope that helps.
Michael Lee
MCL Systems Inc.
Terry Pickering wrote:
> I have a file that I want to display in a cluster where the order is
> different than any of the indexes in the file. I have another file though
> that I could use to "drive" this primary file so they would be retrieved in
> the order I want. In this case I want to retrieve them in customer-num
> order, which is not an index on WPS-PO-MST but is on GLS-PO-DRIVER.
>
> The driver file (GLS-PO-DRIVER) has multiple records for the same
> VENDOR-NUM. After entering the VENDOR-NUM, then I do WHILE RETRIEVING for
> all of these records and retrieve the primary record (WPS-PO-MST) and
> display them.
>
> The problem I'm having is that it will only display up to the number of
> records in the "cache" and no further. In the example below I've purposely
> set the cache to a low number for testing purposes, but it works the same
> way at 255. After displaying the last record in the cache, it starts over
> with the first record.
>
> If I take the "MISSING" off of the FOR statement, I only get one record
> displayed. There are several hundred records in GLS-PO-DRIVER for this
> VENDOR-NUM.
>
> I've tried not using caching at all, and get the same results.
>
> Here is my sample screen:
>
> SCREEN GLS_EXE:TPK016 ACTIVITIES FIND
>
> FILE WPS-PO-MST PRIMARY OCCURS 14 CACHE 20
>
> FILE GLS-PO-DRIVER DESIGNER
>
> FIELD VENDOR-NUM OF GLS-PO-DRIVER
>
> CLUSTER OCCURS WITH WPS-PO-MST
> ALIGN (1,,1) (10,,10)
> FIELD PO-NUM OF WPS-PO-MST SIZE 6
> FIELD CUSTOMER-NUM OF WPS-PO-MST
>
> ;*********************** PROCEDURES ***************************
>
> ;************************
> PROCEDURE PATH
> ;************************
> BEGIN
> REQUEST VENDOR-NUM OF GLS-PO-DRIVER
> LET PATH = 1
> END
>
> ;************************
> PROCEDURE INTERNAL GET-WPS-PO-MST
> ;************************
> BEGIN
> FOR MISSING WPS-PO-MST
> BEGIN
> GET WPS-PO-MST VIA PO-NUM USING PO-NUM OF GLS-PO-DRIVER
> END
> END
>
> ;************************
> PROCEDURE FIND
> ;************************
> BEGIN
> WHILE RETRIEVING GLS-PO-DRIVER VIAINDEX VENDOR-CUSTOMER-KEY &
> USING VENDOR-NUM OF GLS-PO-DRIVER
> DO INTERNAL GET-WPS-PO-MST
> END
>
> BUILD
>
> Terry Pickering
> Eugene School District 4J
> (503) 687-3416
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.