Internal Tables and Field Symbols

Embed Size (px)

Citation preview

  • 8/18/2019 Internal Tables and Field Symbols

    1/12

    Definicion de Tipos tabla.

    Defining Local Table (Types)

  • 8/18/2019 Internal Tables and Field Symbols

    2/12

    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 alsomaintained internally. Both index and key access are possible.

    Hashed tables

    In hashed tables, the data records are managed to optimize runtime. A uniquekey is required to do so. ashed tables only support key access.

    Standard tables with local, explicitly defined type. Example

  • 8/18/2019 Internal Tables and Field Symbols

    3/12

  • 8/18/2019 Internal Tables and Field Symbols

    4/12

    Internal Table perations

    !dding Lines by "ey !ccess

    Standard table

    The record is appended to the table . that is, the statement has the exact same

    e!!ect as the APPEND statement.

    Sorted table

    I! the key is unique, the line is inserted in ascending sort order, in accordance

    with the key de!inition. I! the key is non"unique, the entry is inserted be!ore the!irst #i! any$ entry with the same key.

    Hashed table

    The record is inserted and an entry is made in the hash index.

  • 8/18/2019 Internal Tables and Field Symbols

    5/12

    !dding Lines by Index !ccess

    #hanging #ontent by "ey !ccess

  • 8/18/2019 Internal Tables and Field Symbols

    6/12

    #hanging #ontent by Index !ccess

    Sorting Internal Tables

  • 8/18/2019 Internal Tables and Field Symbols

    7/12

    $eading a Single $ecord by "ey !ccess

    $eading a Single $ecord by Index !ccess

    Loop %rocessing by "ey !ccess

    Loop %rocessing by Index !ccess

    Internal Tables with a &eader Line (header line esta obsoleto)

  • 8/18/2019 Internal Tables and Field Symbols

    8/12

    S'mmary

    sing ield Symbols and $eferences for and in InternalTables

  • 8/18/2019 Internal Tables and Field Symbols

    9/12

    Field-Symbols

    Generalmente, se utiliza el work área para procesar la tabla interna para añadiry modifcar los registros. Podemos reducir el tiempo y meorar el rendimientodel programa mediante el uso de los feld-symbols.

    !uando usamos un "##P con el work area, el sistema necesita aplicar losrecursos para poner el registro necesario en el work area, procesarlo y mo$erlode nue$o a la tabla si es necesario. %ste tiempo de procesamiento adicionalpodr&a ser sal$ado mediante el feld-symbol.

    'ediante el uso de los feld-symbol podemos a(orrar este tiempo adicional ymeorar el rendimiento. Field-s&mbolos son similares a los apuntadores sinre)erencia en !. 'ientras se utiliza el feld-symbol, el sistema utiliza la mismamemoria asignada a ese campo en particular en el registro en lugar de mo$erloal área de procesamiento y trabaar

    *ariables de +e)erencia

    na $ariable de re)erencia acta como un simple puntero, ecepto /ue no sepuede incrementar o reducir la direcci0n de memoria como en ! 1ptr 22, ptr--y tal3. "a di)erencia de un feld-Symbol por/ue se puede comparar dosre)erencias de datos para comprobar si apuntan a eactamente el mismo lugaren la memoria. "a comparaci0n de dos feld-symbols será una simplecomparaci0n de $alor. #tra di)erencia es /ue se puede asignar memoriadinámicamente mediante la creaci0n de $ariables de re)erencia, con lainstruccion !+%45% 6454. n feld-symbol s0lo se puede asignar a una $ariableya asignados.

  • 8/18/2019 Internal Tables and Field Symbols

    10/12

    $eferencing d'ring $ead and Loop %rocessing

    $eferences to Inserted or #hanged Single Lines

  • 8/18/2019 Internal Tables and Field Symbols

    11/12

    !ccessing *ested Tables with ield Symbols

    %ample

  • 8/18/2019 Internal Tables and Field Symbols

    12/12

    Example of Loop %rocessing with ield Symbols when Inserting*ew Data

    Example of Loop %rocessing with ield Symbols in 'tp't