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

Reg: Uploading data to DB2 using JCL


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

New User


Joined: 03 Aug 2006
Posts: 42
Location: Chennai

PostPosted: Wed Mar 14, 2007 5:06 pm
Reply with quote

Hi,

Can someone please provide me a JCL which will update the DB2 tables by reading the flat files(I.e. PS)...

Thanks,
Mk icon_smile.gif
Back to top
View user's profile Send private message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Wed Mar 14, 2007 5:50 pm
Reply with quote

Hi MK..
May be you are expecting too much from JCL icon_sad.gif ..
I dont think anybody is having solution for this..

WIth Regs
Venkat
Back to top
View user's profile Send private message
muthukannan

New User


Joined: 03 Aug 2006
Posts: 42
Location: Chennai

PostPosted: Wed Mar 14, 2007 5:53 pm
Reply with quote

Hi Venktv,

Thanks for your reply.
But i heard we can unload and load using JCL.
So i need the load concept to load data from PS to DB2.

Thanks,
Mk icon_smile.gif
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Mar 14, 2007 6:35 pm
Reply with quote

Hi,

One thing you can do is to load the data in the file to temp table(You can create the temp table in the file format itself ) using a QMF proc.

Create QMF header for the table and also add QMF delimiter between each file field of yours and then add the file to the QMF header nthrough a merge step. Then export that to QMF using EXPORT DATA. Then save the data into a temp table using save data as tem_table. Execute an update query with temp table to update the table u desire. Erase the temp table. If the rows loaded to temp table are going too high, this might consume more time as this temp table does not have index.

Alternatively you can also load the data to temp table. But it requires a temp table to be crated before you execute a load. This will become difficut if you have to schedule this job and also first method make use of a temp table only during the time of execution.

I know this is a bit complicated. Please let me know if you have any qns?

Thanks,
Prajesh
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 14, 2007 9:19 pm
Reply with quote

If you have records in the flat file, then you got to use the LOAD utility. It makes your life easy. Make sure the LOAD control card matches the File layout. If you are not aware of LOAD utility then its time to go thru manuals. Thats a huge concept and intersting too.
Back to top
View user's profile Send private message
muthukannan

New User


Joined: 03 Aug 2006
Posts: 42
Location: Chennai

PostPosted: Thu Mar 15, 2007 2:23 pm
Reply with quote

Hi All,

Thank for your replies.
Am trying to learn from the manuals.

Thanks,
Mk icon_smile.gif
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Mon Mar 19, 2007 6:59 pm
Reply with quote

Use loadplus and unload plus --if these are there in ur shop

Please let me know if u stuck on the above
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Wed Mar 21, 2007 4:03 pm
Reply with quote

Hi you can use the below mentioned jcl for your requirement. but still you need to provide control cards which you are using while unloading the data from db2 or you have give the correct structuer of the components if you didn't unload data from db2. please let me know if you have any queries.

//LOAD01A EXEC PGM=DSNUTILB,
// REGION=0M,
// PARM=(DB2T,'LOADNVL')
//ABNLIGNR DD DUMMY
//DSSPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=F
//UTPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
LOAD DATA INDDN SYSREC LOG NO MAPDDN SYSMAP
RESUME YES
ENFORCE NO
SORTDEVT SYSDA SORTNUM 12
WORKDDN (SYSUT1,SORTOUT)
INTO TABLE NVL.RETAIL_INVOICE

Thanks!
Rathna Reddy,
Sr. Software Engineer.
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top