[Migrated content. Thread originally posted on 23 October 2009]
We have a window to query some text in a specific field of our files (like search a description in a goods file) where we ask if the text is in capital letters or if can be in the middle of the description. Example:Search the goods with the text "AVE" in their descriptions, like "TABLE AVE", "CHAIR average", "MOJAVE SHIRT", bla bla.
Actually, we go through all the file from the begining to the end with read-next sentences comparing with the inspect sentence if "AVE" is in the description of that good (we turn both data in the process, text to search and the description, to capital letters to simplify things).
Of course, it spend a lot of time if the data base is big, and there is my question:
Are there another ways to do this faster with the new v7, v8, etc of the runtime? i mean some type of indexes or something. Any ideas?
This is a typical file def that we use:
SELECT acuc
ASSIGN TO RANDOM "acuclave.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
FILE STATUS IS status-variable
RECORD KEY IS Acuc-key.
FD acuc EXTERNAL .
01 acuc-reg.
03 acuc-key.
05 acuc-usuario PIC x(20).
03 acuc-contrase?a PIC x(10).
03 acuc-contrase?a-desbloqueo PIC x(10).
03 acuc-contrase?a-desbloqueo-cobros PIC x(10).
03 acuc-nombre PIC x(30).
03 acuc-actualizacion PIC x(01).
03 acuc-acceso-costos PIC x(01).
03 acuc-acceso-ventas PIC x(01).
03 acuc-acceso-claves PIC x(01).
03 acuc-autorizacion PIC x(01).
03 acuc-bloqueado PIC x(01).
03 acuc-refresco-mensaje PIC 9(04)
USAGE IS COMP-3.
03 acuc-refresco-red PIC 9(04)
USAGE IS COMP-3.
03 acuc-refresco-dietario PIC 9(04)
USAGE IS COMP-3.
03 acuc-logo-animado PIC x(01).
03 acuc-administrador PIC x(01).
03 acuc-email PIC x(50).
03 acuc-datos-actualizacion.
05 acuc-fecha-ultima-actualizacion PIC 9(08)
USAGE IS COMP-4.
05 acuc-usuario-ultima-actualizacion PIC x(20).
05 acuc-hora-ultima-actualizacion PIC 9(04)
USAGE IS COMP-3.
05 acuc-programa-ultima-actualizacion PIC x(08).
03 acuc-contrase?a-desbloqueo-riesgo PIC x(10).
03 acuc-contrase?a-desbloqueo-margen PIC x(10).
03 acuc-filler PIC x(54).
*
acuc-Declaratives.
perform errdecl
.
*
acuc-Open-File.
if externo = "S" or "s"
continue
else
if (gestion = "S" or "s") or
(contabilidad = "S" or "s")
open i-o acuc
end-if
end-if
.
*
acuc-Close-File.
if externo = "S" or "s"
continue
else
if (gestion = "S" or "s") or
(contabilidad = "S" or "s")
close acuc
end-if
end-if
.
Thanks afterwards



