(800) 219-8613sales@ashwoodcomputer.com
 
FacebookTwitterYouTubeLinkedin
Ashwood Computer, Inc.
Ashwood Computer, Inc.
Your Total Solution Provider
  • Home
  • About Us
    • Blog
    • Careers
  • Products & Services
    • ForeMost
    • FastBac DR
    • Training & Education
    • Fund Accounting
    • Evoke by BlueFinity
  • Testimonials
  • Contact
Menu back  

Using a BASIC Matrix to Improve Performance

April 24, 2019Leave a commentUncategorized

Using a dimensioned matrix in basic can be used to increase performance in some applications. The matrix can cache records commonly read from the disk. This works best when you are reading a small number of records over a much larger set of records.

An example is you have 100 stores and you are updating the store records with credit card transactions which number in the thousands or millions. You would cache the store records in the dimensioned matrix and then write them out at the end of the process. The code is written for brevity in the post.

Example:


PROGRAM UPDATE.STORE.CC
DIM STORES(100)
STORE.IDS = "" ;* ATTR 1 = STORE.ID, ATTR 2 = POINTER TO WHERE THE RECORD IS AT IN THE MATRIX
STORE.PTR = 0
*
OPEN '','STORES' TO STOTRES.FV ELSE STOP
OPEN '','CC.TRANS' TO CC.TRANS.FV ELSE STOP
SELECT CC.TRANS.FV
EOF = @FALSE
LOOP
READNEXT CC.TRANS.ID ELSE EOF = @TRUE
UNTIL (EOF) DO
READ CC.TRANS.REC FROM CC.TRANS.FV, CC.TRANS.ID ELSE CONTINUE
STORE.ID = CC.TRANS.REC<1>
LOCATE(STORE.ID,STORE.IDS,1;STORE.POS;"AR") ELSE ;* LOCATE IS FASTER THAN A DISK IO
STORE.PTR = STORE.PTR + 1 ;* MAKE ROOM FOR A NEW STORE RECORD
READ STORES(STORE.PTR) FROM STORES.FV, STORE.ID ELSE CONTINUE ;* READ THE STORE RECORD ONCE
INS STORE.ID BEFORE STORE.IDS<1,STORE.POS> ;* UPDATE ATTR 1
INS STORE.PTR BEFORE STORE.IDS<2,STORE.POS> ;* UPDATE ATTR 2
END
STORE.PTR = STORE.IDS<2,STORE.POS> ;* GET POINTER TO STORE IN MATRIX
STORE.REC = STORES(STORE.PTR) ;* CACHED STORE RECORD
...
REPEAT
* WRITE OUT CACHE TO DISK
FOR I = 1 TO STORE.PTR
STORE.ID = STORES.IDS<1,I>
STORE.PTR = STORES.ID<2,I>
WRITE STORES(STORE.PTR) ON STORES.FV, STORE.ID
NEXT I
STOP
END

Share this post
FacebookTwitterGoogle+PinterestLinkedIn
Related posts
As one of the only IBM Business Partners serving MultiValue Database Users we’re excited to offer this New IBM Storage Solution!
February 11, 2021
Improve Your Back-Up Processes with Ashwood’s Pre-Processor – FastBac!
February 10, 2021
Interested In Low Code For Your MultiValue System? You Need EVOKE From BlueFinity!
January 20, 2021
Ashwood’s ‘A-TEAM’ Providing 2020 Recovery Assistance!
January 14, 2021
We Thought You Might Appreciate This Article on Minimizing The Impact Of Ransomware From Arrow
December 15, 2020
BlueFinity’s Latest Press Release – Announcing New Built-In Retail Functionality To Benefit All Businesses!
December 8, 2020
Leave Comment

Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

clear formSubmit

Get in touch

    Name *

    Email Address *

    Message *

    Ashwood Computer, Inc.
    • Address
      10671 Techwoods Circle Cincinnati, Ohio 45242
    • Telephone
      (800) 219-8613
      (513) 563-2800
    • Fax
      (513) 554-6412

    Find us on:

    FacebookTwitterYouTubeLinkedinMail
    Ashwood’s Blog
    • As one of the only IBM Business Partners serving MultiValue Database Users we’re excited to offer this New IBM Storage Solution!
      February 11, 2021
    • Improve Your Back-Up Processes with Ashwood’s Pre-Processor – FastBac!
      February 10, 2021
    • Interested In Low Code For Your MultiValue System? You Need EVOKE From BlueFinity!
      January 20, 2021
    Our Value – Added
    • Quality Policy

      Ashwood Computer, Inc. provides quality products and services that consistently meet our customer's requirements, while continually searching for ways to improve them.

    • Experienced Staff

      Our experienced project managers will help you successfully accomplish your goals on time and with optimum results! Our continuing success is attributed to the diverse backgrounds of our technical staff and our overall company drive for Total Customer Satisfaction!

    • ForeMost

      ForeMost ERP is an impressive new 'Hybrid' Solution developed utilizing our mvTools.
      ForeMost is dramatically improving our customers information systems and business operations. Moreover ForeMost provides our customers a significant competitive advantage!

    © 2017 Ashwood Computer, Inc.

    Ashwood Computer adheres to ISO 9001:2008 standards, a quality management system recognized around the world for quality design and production.