View previous topic :: View next topic
|
Author |
Message |
raam_kumar
New User
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
|
|
|
|
Hi
could any one please help me on below requirement
I have a PS file
rec1
rec2
rec3
rec4
rec5
i have a table with some data
rec1
rec2
rec6
rec7
i have to load the PS file in to the table (without using COBOL program) in such a way that, if record already exists in both PS file and table. the contents of the table should be over written with PS file contents. if the record is not available in table the data should be created in table freshly. can this be done anyway? can any one suggest the LOAD card for this requirement? |
|
Back to top |
|
|
prasad.anet
New User
Joined: 10 May 2007 Posts: 2 Location: hyderabad
|
|
|
|
by using fileaid-db2:
U can take the table dump in to a flat file and compare both files delete duplicate records from the flat file( table)
put these records in to one file and load this file in to the table( after deleting the records from that table) |
|
Back to top |
|
|
ahr
New User
Joined: 24 Apr 2007 Posts: 14 Location: India
|
|
|
|
Hi Raam Kumar,
You can use the Load utility, and set the proper options on parameter 'RESUME= ', it will load only the non-exsisting records.
I think you can contact your DBA, he will give a JCL to load data into DB2 table or any of your senior team members might have a jcl to load data into DB2 table. |
|
Back to top |
|
|
raam_kumar
New User
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
|
|
|
|
ahr wrote: |
You can use the Load utility, and set the proper options on parameter 'RESUME= ', it will load only the non-exsisting records.
|
could anyone please let me know the LOAD card which can
1) load the non-existing records
2) update the existing records |
|
Back to top |
|
|
ahr
New User
Joined: 24 Apr 2007 Posts: 14 Location: India
|
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
ahr wrote: |
You can use the Load utility, and set the proper options on parameter 'RESUME= ', it will load only the non-exsisting records.
|
This I think is not correct. Load has no way to compare input records with records already present in table for uniqueness.
You can however create a unique index on those columns in table that you want to compare. Then if you load, it will load only the unique ones and discard the rest. This is assuming that the records in table are already unique. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
wanderer wrote: |
You can however create a unique index on those columns in table that you want to compare. Then if you load, it will load only the unique ones and discard the rest. This is assuming that the records in table are already unique. |
Could the same data then be run through the same utility with an update command? |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
William Thompson wrote: |
Could the same data then be run through the same utility with an update command? |
I am sorry but I did not understand. Could you explain a little? |
|
Back to top |
|
|
|