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: 2276
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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