Very Slow Access Time for KSAM-XL File

Jeff Hoffman wonicon@bigpond.net.au
Thu, 11 Oct 2001 08:08:31 +1000


Hi Kate


Possible solution, but do not quote me on the exact syntax.


screen siqs activities find


temp beg-index char*10

temp end-index char*10

temp env-var   char*30 reset at startup


file *sub-file 

  access sequential


file crsksam secondary

  access viaindex c-index using c-index of sub-file


field beg-index

field end-index

skip 1

field c-index of crsksam

field c-sess-crs-sec1 of crsksam


PROCEDURE PATH

  BEGIN

    REQUEST BEG-INDEX

    IF PROMPTOK

      THEN REQUEST END-INDEX

    IF PROMPTOK

      THEN LET PATH = 1

    IF PATH = 0

      THEN ERROR "Key/Index required."

<color><param>0000,0000,8080</param>    let env-var = " "

</color>    END


PROCEDURE FIND

  BEGIN

    if env-var = " "

    then begin

       let env-var = trunc(beg-index) + "," + trunc(end-index)

       setsysetmval ("CKEY",env-var)

       run command "Quiz auto=???"

       end

    GET sub-file SEQUENTIAL

    get crsksam viaindex c-index using c-index of sub-file

    END


BUILD


QUIZ program


access crsksam

cho c-index systemvalue "CKEY" range

set rep lim ????

sort on c-index

set subfile name sub-file keep at c-index

rep sum c-index

go


If you only want to look at the data you could just use a 2 pass quiz
report.


Jeff



At 12:07 PM 10/10/01 -0600, you wrote:

>I'm using Quick and accessing a KSAM-XL file sequentially viaindex.

>There are three indexes in this ksam file and I'm accessing using one
of

>the indexes.  I also use select with the file statement.  I'd like to

>select records from the ksam file based on a range of values that I

>request.  There are only 13,000 records in the ksam file but record

>selection takes a very long time (I stopped the process after about 8

>minutes).  Are there any suggestions for making this screen run 
faster?

>I'm using PowerHouse 8.29D3 on an HP-3000 box.  I have included the

>Quick code and ksam file structure below.  Thanks in advance

>

>Quick code:

>

>screen siqs activities find

>

>temp beg-index char*10

>temp end-index char*10

>

>file crsksam primary

>  access sequential viaindex c-index request beg-index, end-index

>  select if c-index >= beg-index and c-index <<= end-index

>

>field beg-index

>field end-index

>skip 1

>field c-index

>field c-sess-crs-sec1

>

>PROCEDURE PATH

>  BEGIN

>    REQUEST BEG-INDEX

>    IF PROMPTOK

>      THEN REQUEST END-INDEX

>    IF PROMPTOK

>      THEN LET PATH = 1

>    IF PATH = 0

>      THEN ERROR "Key/Index required."

>    END

>

>PROCEDURE FIND

>  BEGIN

>    GET CRSKSAM VIAINDEX C-INDEX SEQUENTIAL

>    END

>

>BUILD

>

>KSAM file structure:

>

>    Record:             CRSKSAM

>    of File:            CRSKSAM

>    Organization:       INDEXED

>    Type:               KSAMXL   (ASCII)

>    Open:               CRSKSAM

>    Description:

>             This file contains the index number related to each

>combined

>             session, department, course + section key and is used to

>             retrieve course information via an index number which is

>             easier to remember and faster to use.

>    Record Size:        36 Bytes

>

>-- Record Contents --

>    Item                                 Type            Size  Occ

>Offset

>    C-INDEX                              CHARACTER          6

>0

>    C-SESS-CRS-SEC1                      CHARACTER         15

>6

>    .C-SESSION1                          CHARACTER          4

>6

>    .C-DEPT1                             CHARACTER          5

>10

>    .C-CRS1                              CHARACTER          4

>15

>    .C-SEC1                              CHARACTER          2

>19

>    C-SESS-CRS-SEC2                      CHARACTER         15

>21

>    .C-SESSION2                          CHARACTER          4

>21

>    .C-DEPT2                             CHARACTER          5

>25

>    .C-CRS2                              CHARACTER          4

>30

>    .C-SEC2                              CHARACTER          2

>34

>

>-- Index Contents --

>

> ** C-INDEX is a 6 byte   UNIQUE PRIMARY  index **

>

>

>    Segment                              Type            Size  Ord

>Offset

>    C-INDEX                              CHARACTER          6    A

>0

>

>

> ** C-SESS-CRS-SEC1 is a 15 byte  REPEATING ALTERNATE  index **

>

>

>    Segment                              Type            Size  Ord

>Offset

>    C-SESS-CRS-SEC1                      CHARACTER         15    A

>0

>

>

> ** C-SESS-CRS-SEC2 is a 15 byte  REPEATING ALTERNATE  index **

>

>

>    Segment                              Type            Size  Ord

>Offset

>    C-SESS-CRS-SEC2                      CHARACTER         15    A

>0

>

>

>

>

>Attachment Converted: "F:\Eudora_wonicon\Attach\linkkati.vcf"

>

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+ Jeff Hoffman                          + e-mail: wonicon@bigpond.net.au    +

+ Director                              +                                   +

+ WoniCon Pty Ltd   (ABN 93 083 502 630)+                          ,-_|\    +

+ 21 Prices Circuit                     + voice: +61 2 9542 1527  /     \   +

+ Woronora    NSW     2232              +                         \_,-._*   +

+ AUSTRALIA                             + mobile: 040 790 3929         v    +

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+