Está en la página 1de 4

****************************************************************** * * 2234-INSERTAR-GTDTCLI * * *

* INSERTA REGISTRO CONTROTO CLIENTE EN LA TABLA DE CLIENTES * SWIFT *

****************************************************************** 2234-INSERTAR-GTDTCLI.

INITIALIZE GTTCCLI

MOVE GT01-NUMCONT MOVE GT01-TIPDOC MOVE GT01-NUMIDEN MOVE GT01-DIGIDEN MOVE CAA-FECHA-OPER2 MOVE GT01-BICBEI(1:10) MOVE GT01-BICBEI(11:10) MOVE '0001-01-01' MOVE GT01-NOMCIUR MOVE '1' MOVE '0' MOVE GT01-CTANPOS MOVE CAA-FECHA-OPER2 MOVE 'A' MOVE ZEROS

TO CLI-CLAVE TO CLI-CODIDENT TO CLI-CLAIDENT TO CLI-DIGIDENT TO CLI-FECHA-ALTA TO CLI-CODIGO-BIC-BEI TO CLI-CODIGO-RECEPTOR TO CLI-FECHA-ENVIO TO CLI-CIU-RECEPTOR TO CLI-IND-PARAMETRIA TO CLI-IND-MULTICASH TO CLI-IND-FORM-CTA TO CLI-FECHA-ESTADO

TO CLI-IND-ESTADO TO CLI-IMPORTE-INICIA CLI-OBSERVA-ESTADO

MOVE CAA-CENTRO-CONT MOVE CAA-USERID MOVE CAA-TERMINAL-CONT

TO CLI-CENTRO-UMO TO CLI-USERID-UMO TO CLI-NETNAME-UMO

EXEC SQL INSERT INTO GTDTCLI VALUES (:CLI-ENTIDAD :CLI-OFICINA :CLI-CUENTA :CLI-CODIDENT :CLI-CLAIDENT :CLI-DIGIDENT :CLI-FECHA-ALTA :CLI-CODIGO-BIC-BEI :CLI-FECHA-ENVIO , , , , , , , , ,

:CLI-CODIGO-RECEPTOR , :CLI-CIU-RECEPTOR :CLI-IND-PARAMETRIA :CLI-IND-MULTICASH :CLI-IND-FORM-CTA :CLI-FECHA-ESTADO :CLI-IND-ESTADO , , , , , , , , , ,

:CLI-OBSERVA-ESTADO :CLI-IMPORTE-INICIA :CLI-CENTRO-UMO :CLI-USERID-UMO

:CLI-NETNAME-UMO

CURRENT TIMESTAMP ) END-EXEC

EVALUATE SQLCODE WHEN 0 CONTINUE WHEN -803 MOVE 'A' TO CLI-IND-ESTADO

PERFORM 2212-ACCEDE-GTDTCLI IF GT01-FORMATO-ACT = GT01-FORMATO MOVE 'GTE0023' MOVE 'CTA/CLIENTE' TO CAA-COD-ERROR TO CAA-VAR1-ERROR

PERFORM 999999-ROLLBACK PERFORM 3000-FINAL ELSE MOVE '1' MOVE '1' TO CLI-IND-PARAMETRIA TO CLI-IND-MULTICASH

IF GT01-FORMATO = 'MT940' MOVE GT01-CTANPOS TO CLI-IND-FORM-CTA

PERFORM 2222-TRAE-NCTA942 ELSE MOVE GT01-CTANPOS TO CLI-OBSERVA-ESTADO(7:2) END-IF PERFORM 2222-UPDATE-MOD-CLI END-IF

WHEN OTHER MOVE 'INSERT CLI' MOVE 'GTDTCLI ' TO ABC-REFERENCIA TO ABC-OBJETO-ERROR

PERFORM 999999-ROLLBACK PERFORM 99999-ABEND-DB2 END-EVALUATE.