Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy of Table record value from one region to another region

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
juananand

New User


Joined: 07 Jan 2009
Posts: 2
Location: New York

PostPosted: Fri Mar 06, 2009 3:16 am    Post subject: Copy of Table record value from one region to another region
Reply with quote

I have a requirement as follows:
Copy the table A data in 1st DB2 region to the table A data in 2nd DB2 region.

Now Table A has the say four columns
Column 1 ,Column2 ,Column3, Column4. Now the value for the Column 1 is populated by Sequence Object SR1 that resides in both 1st DB2 region and the 2nd DB2 region and generates numbers in their own region.

When I copy the data of table a from 1st DB2 Region to 2nd db2 region apart from the column 1 (which is generated by Sequence object SR1) the rest of the values can be same.

I thought of one option to do this (though I am not sure)
1) Unload the data of Table A in 1st DB2 region into a data set
2) Edit the dataset by replacing the Column 1 values with an sql script that generates the next value of the sequence object
3) Transfer the data set from 1st DB2 region to 2nd DB2 region using NDM utility
4) Load the data into the Table A in the 2nd region from the data set.

Now my question is when Loading would it execute the sql script to generate the next value of the Sequence object SR1 pertaining to the 2nd region.

Is there any other way (other than a program that reads the dataset and inserts into the table in which I could use the generation of the next value of Sequence object and insert the record)?..

Please suggest
Back to top
View user's profile Send private message

jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Fri Mar 06, 2009 10:25 am    Post subject: Re: Copy of Table record value from one region to another re
Reply with quote

Hi ,

Could you please add-on some more details i.e Definition of table .... what i got is you have table1 in X region with defintion of auto generating key sequence and same table in Y region and you have some records in X region table which when inserted created an autogenerated key.

Now you want to insert all the records from X region table into Y region table wherein the autogenrarted key of X table should be key of Y region table i.e in Y region table no key should be autogenerated itself.

Thanks,
Jaspal Virk
Back to top
View user's profile Send private message
juananand

New User


Joined: 07 Jan 2009
Posts: 2
Location: New York

PostPosted: Fri Mar 06, 2009 8:02 pm    Post subject: Reply to: Copy of Table record value from one region to anot
Reply with quote

Hi Jaspal,
You have partly correct in your understanding of the requirement. To give a better explanation I give the project scenario

Currently the user has to populate the value for the Table A (through application) in region X and again has to populate the value for the Table A (through application) in region Y. The business requirement is to reduce this duplicate effort such that now the user is enough to populate the value for the Table A (through application) in region X and request to have the value populated for the Table A in Region Y.

Now currently when the user initiates the population of the value for the Table A in region X the program P1 that does the population generates the value for Column1 using the Sequence object SR1 pertaining to X region.

Again when the user inititate the population of the same value for table A in region Y the program P1 (Same program residing in Y region) that does the population generates the value for Column1 using the Sequence object SR1 pertaining to Y region. So except the column1 value (since it is generated by the Sequence Object SR1 that resides in X and Y region) the rest of the column values are same in Table A in both regions X and Y.

Therefore as per the new requirement (where the user populates the value only in X region and request to populate the same value in Y region) the same output must be achieved i.e. excluding the column 1 (which is populated using Sequence Object SR1) the rest of the column values should be same in Table A in both region X and Y.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us