Cheers
Harald
//******** JOB (8950,D743),'EZT1',CLASS=A,MSGCLASS=6,
// NOTIFY=*******,MSGLEVEL=(0,0),REGION=2048K
//*
//S010 EXEC CAFGT,PGMPARM=LIST
//*
//TRIN01 DD DSN=*******.********,DISP=SHR
//*
//TRUT01 DD DSN=*******.********.S03504.DATA1,
//* DISP=SHR
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=180),
// SPACE=(CYL,(5,1),RLSE)
//*
// NOTIFY=*******,MSGLEVEL=(0,0),REGION=2048K
//*
//S010 EXEC CAFGT,PGMPARM=LIST
//*
//TRIN01 DD DSN=*******.********,DISP=SHR
//*
//TRUT01 DD DSN=*******.********.S03504.DATA1,
//* DISP=SHR
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=180),
// SPACE=(CYL,(5,1),RLSE)
//*
//SYSIN DD *
FILE TRIN01
IN-TYP 1 1 A
IN-AVTAL-TEXT 36 5 A
IN-AVTAL 45 6 A
IN-DEBITERAS 89 12 A
IN-TYP2 2 7 A
IN-TYP3 2 18 A
IN-PENG2 95 6 N
IN-PENG3 95 6 N
IN-NAMN 2 100 A
FILE TRUT01
UT-NAMN 1 99 A
UT-PENG2 100 6 N
UT-PENG3 107 6 N
UT-SUMMA 114 6 N
UT-AVTAL 121 6 A
UT-ALL 1 180 A
WS-VAR1 W 6 N VALUE ZEROS
WS-VAR2 W 6 N VALUE ZEROS
WS-VAR3 W 6 N VALUE ZEROS
WS-AVTAL W 6 A
*
JOB INPUT TRIN01
*
* MOVE SPACE TO UT-ALL
IF IN-TYP = '2'
WS-NAMN = IN-NAMN
END-IF
IF IN-AVTAL-TEXT = 'Avtal'
WS-AVTAL = IN-AVTAL
END-IF
IF IN-TYP = '6'
WS-VAR1 = IN-PENG2
END-IF
IF IN-TYP2 = 'A-Porto'
WS-VAR2 = IN-PENG3
END-IF
IF IN-DEBITERAS = 'Debiteras ej'
UT-NAMN = WS-NAMN
UT-AVTAL = WS-AVTAL
UT-PENG2 = WS-VAR1
UT-PENG3 = WS-VAR2
UT-SUMMA = WS-VAR1 + WS-VAR2
PUT TRUT01 FROM TRUT01
END-IF
FILE TRIN01
IN-TYP 1 1 A
IN-AVTAL-TEXT 36 5 A
IN-AVTAL 45 6 A
IN-DEBITERAS 89 12 A
IN-TYP2 2 7 A
IN-TYP3 2 18 A
IN-PENG2 95 6 N
IN-PENG3 95 6 N
IN-NAMN 2 100 A
FILE TRUT01
UT-NAMN 1 99 A
UT-PENG2 100 6 N
UT-PENG3 107 6 N
UT-SUMMA 114 6 N
UT-AVTAL 121 6 A
UT-ALL 1 180 A
WS-VAR1 W 6 N VALUE ZEROS
WS-VAR2 W 6 N VALUE ZEROS
WS-VAR3 W 6 N VALUE ZEROS
WS-AVTAL W 6 A
*
JOB INPUT TRIN01
*
* MOVE SPACE TO UT-ALL
IF IN-TYP = '2'
WS-NAMN = IN-NAMN
END-IF
IF IN-AVTAL-TEXT = 'Avtal'
WS-AVTAL = IN-AVTAL
END-IF
IF IN-TYP = '6'
WS-VAR1 = IN-PENG2
END-IF
IF IN-TYP2 = 'A-Porto'
WS-VAR2 = IN-PENG3
END-IF
IF IN-DEBITERAS = 'Debiteras ej'
UT-NAMN = WS-NAMN
UT-AVTAL = WS-AVTAL
UT-PENG2 = WS-VAR1
UT-PENG3 = WS-VAR2
UT-SUMMA = WS-VAR1 + WS-VAR2
PUT TRUT01 FROM TRUT01
END-IF