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: 2284
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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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