View previous topic :: View next topic
|
Author |
Message |
CICS fan
New User
Joined: 03 Apr 2008 Posts: 82 Location: United States
|
|
|
|
All,
We have two tables A and B where B is the child table with refrential integrity set as RESTRICT.
We are using a REORG DISCARD to archive rows from A using something like this.
Code: |
REORG TABLESPACE TS1 SHRLEVEL REFERENCE
PUNCHDDN LOADSTMT DISCARDDN SYSDISC
UNLOAD CONTINUE
DISCARD
FROM TABLE A
WHEN (TRANS_DATE <= CURRENT DATE - 3 MONTHS) |
This is obviously throing B into check pend. Now, we can change the rule to cascade and I ahve two questions on that.
1. If we set this as CASCADE will the rows on B will also be archived?
2. We can provide a archive dataset for A in 'DISCDS'. But can we provide a similar dataset name for 'B'?
Thanks for any help. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi CICSfan,
Quote: |
1. If we set this as CASCADE will the rows on B will also be archived? |
No. Rows will be deleted in B, when a delete statement is executed in A. Since you are archiving A table via REORG, B will be put in check-pending.
Quote: |
2. We can provide a archive dataset for A in 'DISCDS'. But can we provide a similar dataset name for 'B'? |
Ofcourse you can. Run the REORG utility with DISCARDS in B then another REORG with DISCARDS for A.
Thanks,
Sushanth |
|
Back to top |
|
|
CICS fan
New User
Joined: 03 Apr 2008 Posts: 82 Location: United States
|
|
|
|
Thanks Sushanth,
Yes, running the reorgs one after another is an option. My question was whether we can run reorg once and have the paretnt table rows and corresponding child table rows archived at one go. So we would need two DISCARD dataset. I cannot find any such option on IBM website. Any ideas? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I cannot find any such option on IBM website. Any ideas? |
Possibly because there is no such option. . .
Suggest you run the 2 reorgs as Sushanth recommended. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
So we would need two DISCARD dataset. |
I have never done it! (so proceed with caution).
Is it possible using templates? I was thinking of something like this:
Code: |
TEMPLATE mydiscrd DSN 'PEDRO.DISCARD.&DB..&TS'
REORG TABLESPACE blah.blah
DISCARDDN mydiscrd
|
|
|
Back to top |
|
|
CICS fan
New User
Joined: 03 Apr 2008 Posts: 82 Location: United States
|
|
|
|
Thank Dick and Pedro.
We eventually decided on running the reorgs in series followed by check utility. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear you have a resolution - thank you for letting us know
d |
|
Back to top |
|
|
|