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
 

 

JCL to insert multiple rows into a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: JCL to insert multiple rows into a table
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: 2239
Location: @my desk

PostPosted: Fri Aug 15, 2008 2:29 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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