Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us