IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to REMOVE orphan records using CHECK DATA utility


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Dec 30, 2008 6:31 pm
Reply with quote

Hi,

I have a parent & child table. Child table has orphan records which are not in the parent table. how to delete these records from the child table.

This is the CHECK DATA job
Code:
//HXSULLCH JOB (T,TEST),'CHECK DATA',CLASS=C,MSGCLASS=X,               
//         NOTIFY=&SYSUID                                             
//*....................................................................
//UTIL0001  EXEC PGM=DSNUTILB,COND=(4,LT),         * CD      (MJUTLCD)
//         PARM='DB2D'                                                 
//STEPLIB  DD  DISP=SHR,DSN=DB2.DB2D.DSNEXIT                           
//         DD  DISP=SHR,DSN=DB2.DB2D.DSNLOAD                           
//SYSPRINT DD  SYSOUT=*                                               
//UTPRINT  DD  SYSOUT=*                                               
//SYSERR   DD  UNIT=SYSDA,DISP=(,PASS),                               
//             SPACE=(CYL,(676,1))                                     
//SYSPUNCH DD  UNIT=SYSDA,DISP=(,PASS),                               
//             SPACE=(CYL,(676,1))                                     
//SYSUT1   DD  UNIT=SYSDA,DISP=(,PASS),                               
//             SPACE=(CYL,(676,1))                                     
//SORTOUT  DD  UNIT=SYSDA,DISP=(,PASS),                               
//             SPACE=(CYL,(676,1))                                     
 CHECK DATA     TABLESPACE SHANDB.SIMPLETS                             
      SCOPE ALL                               
      SORTDEVT SYSDA SORTNUM 03               


Thank You,
Sushanth Bobby
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Dec 31, 2008 3:53 pm
Reply with quote

Got it. I used EXCEPTION TABLE

Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top