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

how to LOAD data into table for specific requirement?


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

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Fri May 11, 2007 11:18 am
Reply with quote

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
View user's profile Send private message
prasad.anet

New User


Joined: 10 May 2007
Posts: 2
Location: hyderabad

PostPosted: Fri May 11, 2007 11:40 am
Reply with quote

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
View user's profile Send private message
ahr

New User


Joined: 24 Apr 2007
Posts: 14
Location: India

PostPosted: Mon May 14, 2007 1:02 pm
Reply with quote

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
View user's profile Send private message
raam_kumar

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Mon May 14, 2007 5:02 pm
Reply with quote

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
View user's profile Send private message
ahr

New User


Joined: 24 Apr 2007
Posts: 14
Location: India

PostPosted: Mon May 14, 2007 8:02 pm
Reply with quote

As of now I don't have any jcls for Loading data into DB2 tables, but I found the below sites, It may help you

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNUGH13/CCONTENTS?DT=20020826194002

www.caliberdt.com/tips/July03_%20DB2_LOAD_Utility.htm
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Tue May 15, 2007 1:07 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue May 15, 2007 1:28 am
Reply with quote

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
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Tue May 15, 2007 3:32 am
Reply with quote

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
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 Store the data for fixed length COBOL Programming 1
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top