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
 

 

how to LOAD data into table for specific requirement?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to LOAD data into table for specific requirement?
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

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

http://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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Tue May 15, 2007 1:28 am    Post subject:
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    Post subject:
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    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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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