We wanted to load two partitions at partition level:
//LOA001 EXEC #DB2UT,
// SYSTEM=T,
// SYSTEMID=L,
// COND=(4,LT),
// SYSUT1=Y,
// LARGE=Y,
// SAR=N
//SYSREC01 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART1
//SYSREC02 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART2
//SYSUT1 DD DATACLAS=DCCNT#08
//SYSIN DD *
LOAD DATA LOG YES
INTO TABLE DBA.VETB0040 PART 1 INDDN SYSREC01 RESUME YES
INTO TABLE DBA.VETB0040 PART 2 INDDN SYSREC02 RESUME YES
The Load works, but unfortunately there are some duplicate keys:
(RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=2 FOR TABLE DBA.VETB0040 PART=1
(RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=2 FOR TABLE DBA.VETB0040 PART=2
(RE)LOAD PHASE STATISTICS - TOTAL NUMBER OF RECORDS LOADED=4 FOR TABLESPACE
DSNU1107I -TL2 017 10:17:42.49 DSNURBXA - UNIQUE INDEX KEY DUPLICATES KEY OF IN
AT RID X'00000000004201',
INDEX = DBA.VEIX0040,
TABLE = DBA.VETB0040,
RECNO = 1,
FOR PART = 1,
RID = X'00000000004203'
DSNU1107I -TL2 017 10:17:42.49 DSNURBXA - UNIQUE INDEX KEY DUPLICATES KEY OF IN
AT RID X'00000000004202',
INDEX = DBA.VEIX0040,
TABLE = DBA.VETB0040,
RECNO = 2,
FOR PART = 1,
RID = X'00000000004204'
- SORTBLD PHASE STATISTICS - NUMBER OF KEYS=0 FOR INDEX DBA.VEIX0040 PART 1
- SORTBLD PHASE STATISTICS - NUMBER OF KEYS=2 FOR INDEX DBA.VEIX0040 PART 2
ORTBLD PHASE STATISTICS. NUMBER OF INDEXES = 1
UILD PHASE STATISTICS - 2 DUPLICATE KEY ERRORS ENCOUNTERED
ORTBLD PHASE COMPLETE, ELAPSED TIME = 00:00:09
NDEXVAL PHASE STATISTICS - 2 DUPLICATE KEY ERRORS, KEY EVALUATION ERRORS, XML
DELETING 2 DATA ROWS
We wanted the job to fail in the case of duplicate keys, so we decided to use the clause DISCARDS 1:
//LOA001 EXEC #DB2UT,
// SYSTEM=T,
// SYSTEMID=L,
// COND=(4,LT),
// SYSUT1=Y,
// LARGE=Y,
// SAR=N
//SYSREC01 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART1
//SYSREC02 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART2
//SYSUT1 DD DATACLAS=DCCNT#08
//SYSIN DD *
LOAD DATA LOG YES DISCARDS 1
INTO TABLE DBA.VETB0040 PART 1 INDDN SYSREC01 RESUME YES
INTO TABLE DBA.VETB0040 PART 2 INDDN SYSREC02 RESUME YES
Then we got this error:
DSNU000I 017 10:29:30.63 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = V17907
DSNU1044I 017 10:29:30.63 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU050I 017 10:29:30.73 DSNUGUTC - LOAD DATA LOG YES DISCARDS 1
DSNU650I -TL1 017 10:29:31.94 DSNURWI - INTO TABLE DBA.VETB0040 PART 1 INDDN
DSNU650I -TL1 017 10:29:31.94 DSNURWI - INTO TABLE DBA.VETB0040 PART 2 INDDN
DSNU319I -TL1 017 10:29:33.27 DSNURWI - RESUME(YES) WAS SPECIFIED FOR EMPTY PAR
DSNU047I 017 10:29:35.29 DSNURELD - A REQUIRED DD CARD OR TEMPLATE IS MISSING. NAME=DISCARDDN
DSNU047I 017 10:29:35.67 DSNURELD - A REQUIRED DD CARD OR TEMPLATE IS MISSING. NAME=DISCARDDN
DSNU012I 017 10:29:35.98 DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8
After adding the DD-CARDs the job ran and abended as requested:
//LOA001 EXEC #DB2UT,
// SYSTEM=T,
// SYSTEMID=L,
// COND=(4,LT),
// SYSUT1=Y,
// LARGE=Y,
// SAR=N
//SYSREC01 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART1
//SYSREC02 DD DISP=SHR,DSN=VTDBM.UL.VETB0040.REC.PART2
//SYSUT1 DD DATACLAS=DCCNT#08
//SYSIN DD *
TEMPLATE DISC000
DSN 'VTDBM.VETB0040.DISC.P&PA(2,4)..D&JD.&HO.&MI.'
DISP (NEW,CATLG,CATLG)
LOAD DATA LOG YES DISCARDS 1
INTO TABLE DBA.VETB0040 PART 1 INDDN SYSREC01 RESUME YES
DISCARDDN (DISC000)
INTO TABLE DBA.VETB0040 PART 2 INDDN SYSREC02 RESUME YES
DISCARDDN (DISC000)
DSNURPTB - BUILD PHASE STATISTICS - 2 DUPLICATE KEY ERRORS ENCOUNTERED
DSNURPTB - DISCARD LIMIT HAS BEEN REACHED
DSNUGBAC - UTILITY BATCH MEMORY EXECUTION ABENDED, REASON=X'00E40323'
Unfortunately the Discard-Datasets are empty.
So the DISCARDDN-DD-Cards are required, but not used.
I reach the limit DISCARDS 1 and then the datasets are empty as described in the manual.
I need the DISCARD dataset because DB2 does not know in advance that the limit is hit or not.
I think it would be more user-friendly, if the LOAD with DISCARDS 1 would not require a DISCARD-Dataset.
Thank you for submitting this enhancement request. The Db2 for z/OS development team reviewd and although it is true that LOAD with DISCARDS 1 would not require the DISCARD dataset, exploitation of such a feature would require further micromanagement of utilities which is contrary to our strategy. Thus there are no plans at this time to implement this.
Sincerely,
Db2 for z/OS Development