Integração com cics

17
Integração com CICS

Transcript of Integração com cics

Page 1: Integração com cics

Integração com CICS

Page 2: Integração com cics

Denifição da CommonArea no JavaTipo de DadoDados Nulos

Refatoração da classe CICSDismistificando tipo COMP e COMP3

Log da aplicação com dados do CICSAUTO-TesteCics

Page 3: Integração com cics

Denifição da CommonArea no Java000 00000000 ^k 000000000

0000000000000000000000000000000000000000000000000000000000 0000000000 00000000000000000 0000000000000000000000000000000000

000011 05 GCCS1150-CODIGO-RETORNO PIC 9(03).

000012 05 GCCS1150-SINAL-SQLCODE PIC X(01).

000013 05 GCCS1150-SQLCODE PIC 9(04).

000014 05 GCCS1150-SQLERRML PIC 9(04).

000015 05 GCCS1150-SQLERRMC PIC X(70).

000016 05 GCCS1150-TABELA-ERR PIC X(18).

000017 05 GCCS1150-DESCRICAO-ERR PIC X(30).

Page 4: Integração com cics

Denifição da CommonArea no Java@CicsGateway

public class SIAW0550_1 extends CTGProgramImpl {

private static final String PGM_NAME = "SIAW0550";

private static final String TRAN_NAME = "SW55";

private static final CommonAreaMetaData COMM_AREA = new CommonAreaMetaData(

new FieldType[] {

new StringFieldType("AREA", 350)});

Page 5: Integração com cics

Denifição da CommonArea no Javaprivate static final CommonAreaMetaData COMM_AREA_IN = new CommonAreaMetaData(new FieldType[] {

new IntegerFieldType("B1040-SUC", 4),

new IntegerFieldType("B1040-RMO", 4),

new IntegerFieldType("B1040-CIA", 4),

new IntegerFieldType("B1040-APO", 8),

new IntegerFieldType("B1040-ITEM", 4),

new IntegerFieldType("B1040-ENDOSSO", 8),

new IntegerFieldType("B1040-NR-PRESTACAO", 3),

new DoubleFieldType("B1040-VL-PARC", 15, 2),

new DoubleFieldType("B1040-PERC-FRACION", 7, 4),

new DoubleFieldType("B1040-VL-ADIC-FRACION ", 15, 2),

new DoubleFieldType("B1040-VL-IOF", 15, 2),

new DateFieldType("B1040-DT-VENC", 8, "ddMMyyyy"),

new DateFieldType("B1040-DT-PGTO", 8, "ddMMyyyy"),

new IntegerFieldType("B1040-TIPO-COBR", 2),

new StringFieldType("FILLER-OUT", 245)});

Page 6: Integração com cics

Denifição da CommonArea no Javaprivate static final CommonAreaMetaData COMM_AREA_OUT = new CommonAreaMetaData(

new FieldType[] {

new StringFieldType("FILLER_IN", 105),

new DoubleFieldType("B1040-VL-PARC-CALC", 15, 2),

new DoubleFieldType("B1040-VL-IOF-CALC", 15, 2),

new DateFieldType("B1040-DT-CALC-PARC", 8, "ddMMyyyy"),

new IntegerFieldType("B1040-ERRO", 1),

new StringFieldType("B1040-MSG-ERRO", 50),

new StringFieldType("FILLER", 156)

});

Page 7: Integração com cics

Denifição da CommonArea no Javaprivate static final CommonAreaMetaData COMM_AREA = new CommonAreaMetaData(

new FieldType[] {new IntegerFieldType("B1040-SUC", 4),

new IntegerFieldType("B1040-RMO", 4),

new IntegerFieldType("B1040-CIA", 4),

new IntegerFieldType("B1040-APO", 8),

new IntegerFieldType("B1040-ITEM", 4),

new IntegerFieldType("B1040-ENDOSSO", 8),

new IntegerFieldType("B1040-NR-PRESTACAO", 3),

new DoubleFieldType("B1040-VL-PARC", 15, 2),

new DoubleFieldType("B1040-VL-IOF-CALC", 15, 2),

new DateFieldType("B1040-DT-CALC-PARC", 8, "ddMMyyyy"),

new IntegerFieldType("B1040-ERRO", 1),

new StringFieldType("B1040-MSG-ERRO", 50),

new StringFieldType("FILLER", 156)

});

Page 8: Integração com cics

Denifição da CommonArea no Java private static final CommonAreaMetaData COMMON_AREA =

new CommonAreaMetaData(

HEADER, new FieldType[] { new StringFieldType("DADO1",30), new StringFieldType("DADO2", 30) } );

public static final FieldType[] HEADER = new FieldType[] { new StringFieldType("HEADER",10), new IntegerFieldType("FUNCAO",2) };

Page 9: Integração com cics

Tipo de Dado

IntegerFieldType

LongFieldType

DoubleFieldType

DateFieldType

StringFieldType

IndexedFieldType

TIPOS BÁSICOS

PIC 9(9)

PIC 9(17)

PIC 9(13)V99

PIC X(10) / PIC 9(10)

PIC X(200)

OCCURS 20

Page 10: Integração com cics

Tipo de Dado

CompFieldType

Comp3FieldType

SignedDoubleFieldType

SignedLongFieldType

TIPOS AVANÇADOS

PIC S9(4) COMP

PIC S9(5) COMP-3

Page 11: Integração com cics

Dados Nulos

03 B1040-SUC PIC X(04).

03 B1040-SUC-R REDEFINES B1040-SUC.

05 B1040-SUC-N PIC 9(04).

03 B1040-RMO-IND-NULL PIC X(1).

03 B1040-RMO PIC 9(04).

Page 12: Integração com cics

Dismistificando tipo COMP e COMP3

TIPO COMP

COBOL: 05 ECPO-COMP PIC S9(4) COMP.

JAVA: new CompFieldType(ECPO_COMP, 2),

Setando Valor: is.setInteger(ECPO_COMP, 1234);Obtendo Valor: rs.getInteger(SCPO_COMP);

Page 13: Integração com cics

Dismistificando tipo COMP e COMP3

TIPO COMP3

COBOL: 05 ECPO-COMP-3 PIC S9(5) COMP-3.

JAVA: new Comp3FieldType(ECPO_COMP_3, 4),

Setando Valor: is.setDouble(ECPO_COMP_3, 1234);Obtendo Valor: rs.getDouble(SCPO_COMP_3);

Page 14: Integração com cics

Refatoração da classe CICS

COMPARANDO COM O DAO

EXEMPLO DA CLASSE CICS

EXEMPLO DA CLASSE FACADE / BO

Page 15: Integração com cics

Log da aplicação com dados do CICS

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"><encoder><pattern>%-40(%d{ISO8601} [%thread])${applicationName} %-5level %-60logger - %msg%n</pattern></encoder></appender>

Page 16: Integração com cics

Log da aplicação com dados do CICS

<logger name="br.com.bradseg.bsad.framework" level="TRACE" /><logger name="br" level="TRACE" />

<root level="TRACE"><appender-ref ref="CONSOLE" /><appender-ref ref="FILE" /></root>

Page 17: Integração com cics

AUTO-TesteCics

http://198.162.60.76:9080/AUTO-TesteCics/testaCics.do

http://provider-it.ddns.info:9080/AUTO-TesteCics/testaCics.do