MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JCL to see discarded duplicate records during load

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
AD7
Beginner


Joined: 25 Oct 2006
Posts: 9
Topics: 4

PostPosted: Thu Dec 14, 2006 6:38 am    Post subject: JCL to see discarded duplicate records during load Reply with quote

Hi All,

I am trying to execute a load onto a table using DSNUTILB, however,
I am getting unique index violation errors for the load for a few records.

I need to find the records for which the unique key violation is happening. When I look at the sysout for the job all I can see are the row ID's of the records for which the violations are occuring.

Can anyone please hint me/provide me a JOB where I can redirect the discarded records to a particular data set.

Thanks,
Anshul
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Dec 14, 2006 7:51 am    Post subject: Reply with quote

AD7,

Your duplicate records will be in the SYSDISC DD dataset from your load job.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AD7
Beginner


Joined: 25 Oct 2006
Posts: 9
Topics: 4

PostPosted: Fri Dec 15, 2006 12:14 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for the quick reply.

I am using the following job for my load, the job loads two tables subsequently -

000017 //********************************************************************
000018 //* DB2LOAD PROCEDURE
000019 //*
000020 //DB2LOAD PROC
000021 //LOAD EXEC PGM=DSNUTILB,PARM='xxxxxxx',REGION=4096K
000022 //STEPLIB DD DSN=SYS1.DSNXY1Z.SDSNLOAD,DISP=SHR
000023 //SYSPRINT DD SYSOUT=*
000024 //UTPRINT DD SYSOUT=*
000025 //SYSABEND DD SYSOUT=*
000026 //SORTWK01 DD UNIT=DISK,DISP=(,DELETE),
000027 // SPACE=(CYL,(25,15))
000028 //SORTWK02 DD UNIT=DISK,DISP=(,DELETE),
000029 // SPACE=(CYL,(25,15))
000030 //SORTOUT DD UNIT=SYSDA,DISP=(,DELETE),
000031 // SPACE=(CYL,(25,15))
000032 //SYSUT1 DD UNIT=DISK,DISP=(,DELETE),
000033 // SPACE=(CYL,(25,15))
000034 //DB2LOAD PEND
000035 //*-------------------------------------------------
000036 //LOAD01 EXEC DB2LOAD
000037 //SYSREC DD DSN=XY1Z.ABC.CCCC.CDC01LD.DATA,DISP=SHR <--- ds containing the data records
000038 //SYSIN DD DSN=XY1Z.ABC.CCCC.CDC.DATA(LD01),DISP=SHR <--- ds containing the load script and table structure
000039 //*
000040 //RES01 EXEC PGM=IEFBR14
000041 //LOAD02 EXEC DB2LOAD
000042 //SYSREC DD DSN=XY1Z.ABC.CCCC.CDC02LD.DATA,DISP=SHR
000043 //SYSIN DD DSN=XY1Z.ABC.CCCC.CDC.DATA(LD02),DISP=SHR
000044 //*

Also, I only get the SYSPRINT and UTPRINT in my spool.

Please tell me how can I modify this job so as to get the SYSDISC DD/ is there any other way I can see the discarded records.

Thank you so much!

Regards,
AD7
Back to top
View user's profile Send private message
AD7
Beginner


Joined: 25 Oct 2006
Posts: 9
Topics: 4

PostPosted: Fri Dec 15, 2006 4:00 am    Post subject: Reply with quote

I tried using ICETOOL to sort the input file and look for the duplicates - but our shop doesn't seem to have it installed, also since the number of records is HUGE, it would really be difficult to look for them, all I need are the records which are duplicates.

I tried using SORT with SUM FIELD=NONE but that only gives me the sorted file without any duplicates.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Dec 15, 2006 5:52 am    Post subject: Reply with quote

AD7,

Add the following to your load job
Code:

//SYSDISC  DD  DSN=load.duplicate.hold.dataset,
//             DISP=(MOD,CATLG,CATLG),             
//             UNIT=SYSDA,                         
//             SPACE=(CYL,(25,25),RLSE),             
//             RECFM=FB         


Check solution # 2 in this link for getting the dups into seperate dataset.

http://www.mvsforums.com/helpboards/viewtopic.php?t=5339

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group