000100 IDENTIFICATION DIVISION.
000110 PROGRAM-ID. PRAC13.
000120 AUTHOR. LUIS CECILIANO.
000130 DATE-WRITTEN. DECEMBER 18, 2019.
000140*ESTE PROGRAMA CARGA UNA LISTA EN UNA BASE DE DATOS
000150 SECURITY. FOREVER.
000200 ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT LISTA ASSIGN TO DISK.
000300 DATA DIVISION.
       FILE SECTION.
           FD LISTA
             VALUE OF DEPENDENTSPECS IS TRUE.
               01 REG-LISTA
                   02 REG-NUMLISTA  PIC 9(04).
                   02 REG-NOMBRE    PIC X(38).
                   02 REG-NUMGPO    PIC 9(02).
       DATA-BASE SECTION.
           DB BD01CURSOS VALUE OF TITLE IS
             "BD01CURSOS ON CREDITO".
       WORKING-STORAGE SECTION.
           01 WKS-EOF-LISTA PIC 9(02) VA 0.
       PROCEDURE DIVISION.
       0000-PRINCIPAL.
           PERFORM 1000-INICIO
           PERFORM 2000-PROCESO
           PERFORM 3000-TERMINA
           STOP RUN.
       1000-INICIO.
           CHANGE ATTRIBUTE TITLE OF LISTA TO 
             "LAHC/FILE/INTE/99902E02/01/191211/LST/TXT".
           IF ATTRIBUTE RESIDENT OF LISTA = VALUE TRUE
               OPEN INPUT LISTA
               PERFORM 9999-LEE-LISTA
           ELSE 
               DISPLAY "NO EXISTE EL ARCHIVO LISTA: "
               MOVE 1 TO WKS-EOF-LISTA.
           OPEN UPDATE BD01CURSOS.
       2000-PROCESO.
           PERFORM 999-DMS-BEGIN-TRANSACTION
           PERFORM 2500-ACTUALIZA-BD01 UNTIL WKS-EOF-LISTA = 1
           PERFORM 999-DMS-END-TRANSACTION.
       2500-ACTUALIZA-BD01.
           PERFORM 2600-CREA-BD01
           PERFORM 2700-MUEVE-DATOS
           PERFORM 2800-GRABA-BD01
           PERFORM 9999-LEE-LISTA.
       2600-CREA-BD01.
           CREATE BD01-CONSULTORES.
       2700-MUEVE-DATOS.
           MOVE REG-NUMLISTA TO BD01-IDCONSULTOR
           MOVE REG-NOMBRE   TO BD01-NOMBRE.
       2800-GRABA-BD01.
           STORE BD01-CONSULTORES
             ON EXCEPTION 
               DISPLAY "REGISTRO YA EXISTENTE.".
       3000-TERMINA.
           CLOSE LISTA.
       9999-LEE-LISTA.
           READ LISTA AT END MOVE 1 TO WKS-EOF-LISTA.
       999-DMS-BEGIN-TRANSACTION.
           BEGIN-TRANSACTION NO-AUDIT BDS90-RESTART.
       999-DMS-END-TRANSACTION.
           END-TRANSACTION AUDIT BDS90-RESTART.
