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

JCL to insert multiple rows into a table


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

New User


Joined: 05 Jan 2008
Posts: 50
Location: Olympia, WA, USA

PostPosted: Fri Aug 15, 2008 10:42 am
Reply with quote

Could anyone help me in how to insert multiple rows into a table using JCL.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Aug 15, 2008 2:29 pm
Reply with quote

satyender,

You can do that using DB2 load jobs.

Thanks,
Arun
Back to top
View user's profile Send private message
krithikaj

New User


Joined: 10 Aug 2008
Posts: 45
Location: India

PostPosted: Mon Aug 18, 2008 3:37 pm
Reply with quote

Hi,

This IBM LOAD JCL will help you load multiple rows from a dataset to DB2 table.

//STEP10 EXEC DB2TUTLL,CONDCDE=4
//* UTPROC='RESTART(PHASE)'
//*
//* COPY DDL DD CREATED IN THE UNLOAD JOB AFTER THE SYSIN DD
//* AND ADD THE REPLACE PARAMETER
//*
//SYSIN DD *
LOAD DATA REPLACE LOG NO INTO TABLE
SCHEMA.TABLENAME <--CHG
STATISTICS TABLE(ALL) INDEX ALL KEYCARD FREQVAL NUMCOLS 9 COUNT 10
SORTNUM 6
SORTDEVT SYSDA
/*
//**********************************************************************
//* CHANGE SYSREC DSNAME TO THE DSNAME FROM THE UNLOAD JOB
//**********************************************************************
//SYSREC DD DSN=UNLOAD.DSNAME, <--CHG
// DISP=SHR
//SYSMAP DD DSN=YOURHLQ.DBNAME.TSPACE.SYSMAP,DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=24000)
//SYSUT1 DD DSN=&&SYSUT1,
// UNIT=SYSDA,
// SPACE=(CYL,(50,10))
//SORTOUT DD DSN=&&SORTOUT,
// UNIT=SYSDA,
// SPACE=(CYL,(50,10))

SYSREC is the input dataset here. If you want to replace the data in table use keyword REPLACE and for just append use REPLACE NO RESUME YES.

Regards,
Krithika J
Back to top
View user's profile Send private message
satyender

New User


Joined: 05 Jan 2008
Posts: 50
Location: Olympia, WA, USA

PostPosted: Mon Aug 18, 2008 9:37 pm
Reply with quote

Thanks a lot Krithika.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top