quarta-feira, fevereiro 24, 2016

GENERATE ADACMP

Para alterar o formato de um campo de um file Adabas temos que fazer vários passos clique aqui, tem uma parte que temos que ir no Predict e gerar as definições do file (Generate ADACMP/ADAWAN Definitions) para poder rodar um ADACMP COMPRESS, lendo o manual do Predict encontrei um exemplo de um jcl que faz isso, fiz alguns teste e deu certo, abaixo o jcl para pegar as definições de um file;
//AAFPNATB JOB (AABS,OSB),CLAUD,CLASS=S,MSGCLASS=A TYPRUN=HOLD
//*UQ ALLOW
//* ------------------------------------------------------------
//*                GENERATE ADACMP - FILE FISICO
//* ------------------------------------------------------------
//LOADDDM EXEC NATURAL,COND=(0,NE),
//  PARM1='SYS=D MT=0 IM=D INTENS=1,OBJIN=N,ESIZE=36,DATSIZE=80',
//  PARM2='STACK=(LOGON SYSDIC),EDPSIZE=48',ID='|'
//CMWKF01  DD DSN=ADA.LIBR.JCLS(CLAU999),DISP=SHR
//SYSIN DD *
MENU
GENERATE ADACMP
FILE-ID=EMPLOYEES-FILE%
DBNR=010%
PUNCH=Y%
MEM=CLAU996%
LIB=ADACMP%
REPLACE=Y
FIN
//CMEDIT  DD DSN=&&DDM2,DISP=(NEW,PASS),UNIT=SYSDA,
//     SPACE=(CYL,15)
Resultado do JOB;
1Logon accepted to library SYSDIC.
1NEXT MENU
1FIELD
 DATA GENERATE ADACMP
1FIELD
 DATA FILE-ID=EMPLOYEES-FILE%
1FIELD
 DATA DBNR=010%
1FIELD
 DATA PUNCH=Y%
1FIELD
 DATA MEM=CLAU995%
1FIELD
 DATA LIB=ADACMP%
1FIELD
 DATA REPLACE=Y
109:48:09             *****  P R E D I C T  4.4.1  *****             2016-02-24
                        - Generate ADACMP Definitions -               Page:   1
0File ID .. EMPLOYEES-FILE
0ADACMP COMPRESS
 ADACMP FILE=1 ADACMP MINISN=1
 ADACMP DEVICE=8391
 ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
 ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
 ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        09:48:09
 ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
 ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
 ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
 ADACMP FNDEF='01,AG,1,A,FI'                  SEX
 ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
 ADACMP FNDEF='01,A1'                         FULL-ADDRESS
 ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
 ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
 ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
 ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
 ADACMP FNDEF='01,A2'                         TELEPHONE
 ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
 ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
 ADACMP FNDEF='01,AO,6,A,DE'                  DEPT
 ADACMP FNDEF='01,AP,25,A,DE,NU'              JOB-TITLE
 ADACMP FNDEF='01,AQ,PE(40)'                  INCOME
 ADACMP FNDEF='02,AR,3,A,NU'                  CURR-CODE
 ADACMP FNDEF='02,AS,5,P,NU'                  SALARY
 ADACMP FNDEF='02,AT,5,P,NU,MU(12)'           BONUS
 ADACMP FNDEF='01,A3'                         LEAVE-DATA
 ADACMP FNDEF='02,AU,2,U'                     LEAVE-DUE
 ADACMP FNDEF='02,AV,2,U,NU'                  LEAVE-TAKEN
 ADACMP FNDEF='01,AW,PE(20)'                  LEAVE-BOOKED
 ADACMP FNDEF='02,AX,6,U,NU'                  LEAVE-START
 ADACMP FNDEF='02,AY,6,U,NU'                  LEAVE-END
 ADACMP FNDEF='01,AZ,3,A,DE,NU,MU(15)'        LANG
 ADACMP PHONDE='PH(AE)'                       PHONETIC-NAME
 ADACMP SUPDE='H1=AU(1,2),AV(1,2)'            LEAVE-LEFT
 ADACMP SUBDE='S1=AO(1,4)'                    DEPARTMENT
 ADACMP SUPDE='S2=AO(1,6),AE(1,20)'           DEPT-PERSON
 ADACMP SUPDE='S3=AR(1,3),AS(1,9)'            CURRENCY-SALARY
0DIC1800 SUMMARY:    34 FIELD(S) PROCESSED.
0SAVED AS MEMBER CLAU995  IN LIB ADACMP   .
 PUNCHED TO WORK FILE 1 .
1FIELD
 DATA FIN
1NAT9995 Natural session terminated normally.
--------------------------------------------------------------------------------
OP=S CL=ALL IN=ALL JB=AAFPNATB,03318 DS=1 SI=SO LR=43 LL=80 PP=0 DC=
RL=999999 AD=J DE= SC= PT= SQ=C RR=0 OC= SD=2000
Na biblioteca Natural ADACMP foi criado o membro CLAU995;
 >                                       > +  Program     CLAU995  Lib ADACMP
 Top    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
   0010 ADACMP COMPRESS
   0010 ADACMP FILE=1
   0010 ADACMP MINISN=1
   0010 ADACMP DEVICE=8391
   0010 ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
   0010 ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
   0010 ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        09:48:09
   0010 ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
   0010 ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
   0010 ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
   0010 ADACMP FNDEF='01,AG,1,A,FI'                  SEX
   0010 ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
   0010 ADACMP FNDEF='01,A1'                         FULL-ADDRESS
   0010 ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
   0010 ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
   0010 ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
   0010 ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
   0010 ADACMP FNDEF='01,A2'                         TELEPHONE
   0010 ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
   0010 ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
        ....+....1....+....2....+....3....+....4....+....5....+... S 38   L 1
Como coloquei PUNCH = YES no JCL criou também na biblioteca (ADA.LIBR.JCLS) o membro CLAU999, aqui consigo editar fácil para criar o jcl de ADACMP;
MEMBER=CLAU999                                                        R=00000001
DSN=ADA.LIBR.JCLS                                LIB=S4 VOL=PRL303 UNIT=1126
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
ADACMP COMPRESS
ADACMP FILE=1
ADACMP MINISN=1
ADACMP DEVICE=8391
ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        09:48:09
ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
ADACMP FNDEF='01,AG,1,A,FI'                  SEX
ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
ADACMP FNDEF='01,A1'                         FULL-ADDRESS
ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
ADACMP FNDEF='01,A2'                         TELEPHONE
ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
Detalhe Importante

Se por acaso você quiser gerar as definições como por exemplo atributos do file que serão usados no LOAD é só usar este exemplo;
//AAFPNATB JOB (AABS,OSB),CLAUD,CLASS=S,MSGCLASS=A TYPRUN=HOLD
//*UQ ALLOW
//* ------------------------------------------------------------
//*                GENERATE ADACMP - FILE FISICO
//* ------------------------------------------------------------
//LOADDDM EXEC NATURAL,COND=(0,NE),
//  PARM1='SYS=D MT=0 IM=D INTENS=1,OBJIN=N,ESIZE=36,DATSIZE=80',
//  PARM2='STACK=(LOGON SYSDIC),EDPSIZE=48',ID='|'
//CMWKF01  DD DSN=ADA.LIBR.JCLS(CLAU999),DISP=SHR
//SYSIN DD *
MENU
GENERATE ADACMP
FILE-ID=EMPLOYEES-FILE%
DBNR=010%
PUNCH=Y%
MEM=CLAU999%
LIB=ADACMP%
REPLACE=Y%
FILE-ATTRIBUTES=Y%
SORTSIZE=500%
TEMPSIZE=500
FIN
//CMEDIT  DD DSN=&&DDM2,DISP=(NEW,PASS),UNIT=SYSDA,
//     SPACE=(CYL,15)
Resultado do JOB;
1Logon accepted to library SYSDIC.
1NEXT MENU
1FIELD
 DATA GENERATE ADACMP
1FIELD
 DATA FILE-ID=EMPLOYEES-FILE%
1FIELD
 DATA DBNR=010%
1FIELD
 DATA PUNCH=Y%
1FIELD
 DATA MEM=CLAU900%
1FIELD
 DATA LIB=ADACMP%
1FIELD
 DATA REPLACE=Y%
1FIELD
 DATA FILE-ATTRIBUTES=Y%
1FIELD
 DATA SORTSIZE=500%
1FIELD
 DATA TEMPSIZE=500
113:08:14             *****  P R E D I C T  4.4.1  *****             2016-02-24
                        - Generate ADACMP Definitions -               Page:   1
0File ID .. EMPLOYEES-FILE
0ADACMP COMPRESS
 ADACMP FILE=1
 ADACMP MINISN=1
 ADACMP DEVICE=8391
 ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
 ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
 ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        13:08:14
 ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
 ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
 ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
 ADACMP FNDEF='01,AG,1,A,FI'                  SEX
 ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
 ADACMP FNDEF='01,A1'                         FULL-ADDRESS
 ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
 ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
 ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
 ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
 ADACMP FNDEF='01,A2'                         TELEPHONE
 ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
 ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
 ADACMP FNDEF='01,AO,6,A,DE'                  DEPT
 ADACMP FNDEF='01,AP,25,A,DE,NU'              JOB-TITLE
 ADACMP FNDEF='01,AQ,PE(40)'                  INCOME
 ADACMP FNDEF='02,AR,3,A,NU'                  CURR-CODE
 ADACMP FNDEF='02,AS,5,P,NU'                  SALARY
 ADACMP FNDEF='02,AT,5,P,NU,MU(12)'           BONUS
 ADACMP FNDEF='01,A3'                         LEAVE-DATA
 ADACMP FNDEF='02,AU,2,U'                     LEAVE-DUE
 ADACMP FNDEF='02,AV,2,U,NU'                  LEAVE-TAKEN
 ADACMP FNDEF='01,AW,PE(20)'                  LEAVE-BOOKED
 ADACMP FNDEF='02,AX,6,U,NU'                  LEAVE-START
 ADACMP FNDEF='02,AY,6,U,NU'                  LEAVE-END
 ADACMP FNDEF='01,AZ,3,A,DE,NU,MU(15)'        LANG
 ADACMP PHONDE='PH(AE)'                       PHONETIC-NAME
 ADACMP SUPDE='H1=AU(1,2),AV(1,2)'            LEAVE-LEFT
 ADACMP SUBDE='S1=AO(1,4)'                    DEPARTMENT
 ADACMP SUPDE='S2=AO(1,6),AE(1,20)'           DEPT-PERSON
 ADACMP SUPDE='S3=AR(1,3),AS(1,9)'            CURRENCY-SALARY
 //
 ADALOD LOAD
 ADALOD FILE=1
 ADALOD NAME=EMPLOYEES-FILE
 ADALOD ASSOPFAC=10
 ADALOD DATAFRM=NO
 ADALOD DATAPFAC=10
 ADALOD DSDEV=8391
 ADALOD DSREUSE=YES
 ADALOD DSSIZE=5B
 ADALOD INDEXCOMPRESSION=YES
 ADALOD ISNREUSE=YES
 ADALOD MAXISN=1377
 ADALOD MINISN=1
 ADALOD NISIZE=3B
 ADALOD SORTSIZE=500
 ADALOD TEMPSIZE=500
 ADALOD UISIZE=5B
 ADALOD ALLOCATION=FORCE
0DIC1800 SUMMARY:    34 FIELD(S) PROCESSED.
0SAVED AS MEMBER CLAU900  IN LIB ADACMP   .
 PUNCHED TO WORK FILE 1 .
1FIELD
 DATA FIN
1NAT9995 Natural session terminated normally.
UQS0009 - END OF DATA SET.

--------------------------------------------------------------------------------
OP=S CL=ALL IN=ALL JB=AAFPNATB,03930 DS=1 SI=SO LR=85 LL=80 PP=0 DC=
RL=999999 AD=J DE= SC= PT= SQ=C RR=0 OC= SD=2000
Criou na biblioteca ADACMP no Natural com o nome CLAU900;
 >                                       > +  Program     CLAU900  Lib ADACMP
 Top    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
   0010 ADACMP COMPRESS
   0010 ADACMP FILE=1
   0010 ADACMP MINISN=1
   0010 ADACMP DEVICE=8391
   0010 ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
   0010 ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
   0010 ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        13:08:14
   0010 ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
   0010 ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
   0010 ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
   0010 ADACMP FNDEF='01,AG,1,A,FI'                  SEX
   0010 ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
   0010 ADACMP FNDEF='01,A1'                         FULL-ADDRESS
   0010 ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
   0010 ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
   0010 ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
   0010 ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
   0010 ADACMP FNDEF='01,A2'                         TELEPHONE
   0010 ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
   0010 ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
        ....+....1....+....2....+....3....+....4....+....5....+... S 57   L 1
No final ficou as definições que vamos usar no LOAD
 >                                       > +  Program     CLAU900  Lib ADACMP
 Bot    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
   0010 ADACMP SUPDE='S3=AR(1,3),AS(1,9)'            CURRENCY-SALARY
   0010 //
   0010 ADALOD LOAD
   0010 ADALOD FILE=1
   0010 ADALOD NAME=EMPLOYEES-FILE
   0010 ADALOD ASSOPFAC=10
   0010 ADALOD DATAFRM=NO
   0010 ADALOD DATAPFAC=10
   0010 ADALOD DSDEV=8391
   0010 ADALOD DSREUSE=YES
   0010 ADALOD DSSIZE=5B
   0010 ADALOD INDEXCOMPRESSION=YES
   0010 ADALOD ISNREUSE=YES
   0010 ADALOD MAXISN=1377
   0010 ADALOD MINISN=1
   0010 ADALOD NISIZE=3B
   0010 ADALOD SORTSIZE=500
   0010 ADALOD TEMPSIZE=500
   0010 ADALOD UISIZE=5B
   0010 ADALOD ALLOCATION=FORCE
        ....+....1....+....2....+....3....+....4....+....5....+... S 57   L 38
Como coloquei PUNCH = YES no JCL criou também na biblioteca (ADA.LIBR.JCLS) o membro CLAU999, aqui consigo editar fácil para criar o jcl de ADACMP
 D
MEMBER=CLAU999                                                        R=00000001
DSN=ADA.LIBR.JCLS                                LIB=S4 VOL=PRL303 UNIT=1126
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
ADACMP COMPRESS
ADACMP FILE=1
ADACMP MINISN=1
ADACMP DEVICE=8391
ADACMP FNDEF='01,AA,8,A,DE,UQ'               PERSONNEL-ID     **********
ADACMP FNDEF='01,AB'                         FULL-NAME        2016-02-24
ADACMP FNDEF='02,AC,20,A,NU'                 FIRST-NAME        13:08:14
ADACMP FNDEF='02,AE,20,A,DE'                 NAME             **********
ADACMP FNDEF='02,AD,20,A,NU'                 MIDDLE-NAME
ADACMP FNDEF='01,AF,1,A,FI'                  MAR-STAT
ADACMP FNDEF='01,AG,1,A,FI'                  SEX
ADACMP FNDEF='01,AH,6,U,DE'                  BIRTH
ADACMP FNDEF='01,A1'                         FULL-ADDRESS
ADACMP FNDEF='02,AI,20,A,NU,MU(8)'           ADDRESS-LINE
ADACMP FNDEF='02,AJ,20,A,DE,NU'              CITY
ADACMP FNDEF='02,AK,10,A,NU'                 POST-CODE
ADACMP FNDEF='02,AL,3,A,NU'                  COUNTRY
ADACMP FNDEF='01,A2'                         TELEPHONE
ADACMP FNDEF='02,AN,6,A,NU'                  AREA-CODE
ADACMP FNDEF='02,AM,15,A,NU'                 PHONE
No final ficou também com as definições que vamos usar no LOAD;
 -1
MEMBER=CLAU999                                                        R=00000039
DSN=AAB.DIST.JCLS                                LIB=S4 VOL=PRL303 UNIT=1126
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
//
ADALOD LOAD
ADALOD FILE=1
ADALOD NAME=EMPLOYEES-FILE
ADALOD ASSOPFAC=10
ADALOD DATAFRM=NO
ADALOD DATAPFAC=10
ADALOD DSDEV=8391
ADALOD DSREUSE=YES
ADALOD DSSIZE=5B
ADALOD INDEXCOMPRESSION=YES
ADALOD ISNREUSE=YES
ADALOD MAXISN=1377
ADALOD MINISN=1
ADALOD NISIZE=3B
ADALOD SORTSIZE=500
ADALOD TEMPSIZE=500
ADALOD UISIZE=5B
ADALOD ALLOCATION=FORCE
 COMPDS0400-D --- End of Data ---


0 comentários:

Enviar um comentário