DB2 Unload using DB2BATCH



IBM's flagship relational database management system

DB2 Unload using DB2BATCH

Postby shankar_dh » Thu Feb 13, 2014 5:22 pm

Hi Forum,

I am unloading the DB2 table to a flat file. Below is my code,

//STEP01 EXEC DSNPGM,
// VER='TEST',
// SYSTEM='TD0T',
// PRM='SQL',
// PROGRAM='DSNTIAUL'
//*-------------------------------------------------------------------*/
//* SYSIN : Contains the SQL commands to fetch the required records.*/
//*-------------------------------------------------------------------*/
//SYSIN DD DSN=AGGT.UTTTTTT.CTLCARDS(CAGG1A01),DISP=SHR
//*-------------------------------------------------------------------*/
//* SYSREC00: This is the output file the DB2 table is unloaded into. */
//*-------------------------------------------------------------------*/
//SYSREC00 DD DSN=AGGT.dataset1,disp=shr
//SYSPUNCH DD DUMMY

I pass the SQLs thru SYSIN and captures the unloaded data into SYSREC00; Like this I have 2 more SQLs, Is there any way to pass those SQLs too and capture the unloaded data into different data sets like SYSREC01,SYSREC02 in the same step instead of writing separate 2 more steps.

And One more thing, When I execute this, I am getting RC04 which is acceptable but How to get the RC00.
Note: When I write SELECT * instead of my required SQL I will get RC00.

Kindly reply me if anybody has solution for my problem.

Thanks,
Shankar.
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: DB2 Unload using DB2BATCH

Postby rajaranganathan » Sat Feb 22, 2014 8:33 pm

Hi Shankar,

Can you please post your sysout for the step where you get RC04 ?


Thanks
Raja.R
rajaranganathan
 
Posts: 27
Joined: Thu Oct 10, 2013 6:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 Unload using DB2BATCH

Postby Gandosio » Mon Mar 10, 2014 8:54 pm

Gandosio
 
Posts: 12
Joined: Tue Dec 21, 2010 3:47 pm
Has thanked: 0 time
Been thanked: 2 times

Re: DB2 Unload using DB2BATCH

Postby shankar_dh » Tue Mar 11, 2014 1:52 pm

Thanks Gandosio. That would be helpful.
I am facing one more problem now.
I highly appreciate if anybody can help me to sort out.
I am unloading the data from DB2 table using DB2BATCH program and capturing the unloaded data into SYSREC00 dataset by passing SQLs through SYSIN.

Please see the attached word document where I have explained my problem clearly.
You do not have the required permissions to view the files attached to this post.
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: DB2 Unload using DB2BATCH

Postby shankar_dh » Tue Mar 11, 2014 3:46 pm

Please ignore my above post.
I have re posted by changing by problem description.

db2/topic9815.html
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post