Вы находитесь на странице: 1из 12

Definicion de Tipos tabla.

Defining Local Table (Types)

Standard tables
In these tables, the line numbering is maintained internally. Both index and
key access are possible.
Sorted tables
In sorted tables, the records are always saved sorted by key. The index is also
maintained internally. Both index and key access are possible.
Hashed tables
In hashed tables, the data records are managed to optimize runtime. A unique
key is required to do so. Hashed tables only support key access.

Standard tables with local, explicitly defined type. Example

Internal Table Operations


Adding Lines by Key Access

Standard table
The record is appended to the table . that is, the statement has the exact same
effect as the APPENDstatement.
Sorted table
If the key is unique, the line is inserted in ascending sort order, in accordance
with the key definition. If the key is non-unique, the entry is inserted before the
first (if any) entry with the same key.
Hashed table
The record is inserted and an entry is made in the hash index.

Adding Lines by Index Access

Changing Content by Key Access

Changing Content by Index Access

Sorting Internal Tables

Reading a Single Record by Key Access

Reading a Single Record by Index Access

Loop Processing by Key Access

Loop Processing by Index Access

Internal Tables with a Header Line (header line esta obsoleto)

Summary

Using Field Symbols and References for and in Internal


Tables

Field-Symbols
Generalmente, se utiliza el work rea para procesar la tabla interna para aadir
y modificar los registros. Podemos reducir el tiempo y mejorar el rendimiento
del programa mediante el uso de los field-symbols.
Cuando usamos un LOOP con el work area, el sistema necesita aplicar los
recursos para poner el registro necesario en el work area, procesarlo y moverlo
de nuevo a la tabla si es necesario. Este tiempo de procesamiento adicional
podra ser salvado mediante el field-symbol.
Mediante el uso de los field-symbol podemos ahorrar este tiempo adicional y
mejorar el rendimiento. Field-smbolos son similares a los apuntadores sin
referencia en C. Mientras se utiliza el field-symbol, el sistema utiliza la misma
memoria asignada a ese campo en particular en el registro en lugar de moverlo
al rea de procesamiento y trabajar
Variables de Referencia
Una variable de referencia acta como un simple puntero, excepto que no se
puede incrementar o reducir la direccin de memoria como en C (ptr ++, ptr-y tal). La diferencia de un field-Symbol porque se puede comparar dos
referencias de datos para comprobar si apuntan a exactamente el mismo lugar
en la memoria. La comparacin de dos field-symbols ser una simple
comparacin de valor. Otra diferencia es que se puede asignar memoria
dinmicamente mediante la creacin de variables de referencia, con la
instruccion CREATE DATA. Un field-symbol slo se puede asignar a una variable
ya asignados.

Referencing during Read and Loop Processing

References to Inserted or Changed Single Lines

Accessing Nested Tables with Field Symbols

Example

Example of Loop Processing with Field Symbols when Inserting


New Data

Example of Loop Processing with Field Symbols in Output

Вам также может понравиться