Page 1 of 1

DB2 Unload using DB2BATCH

PostPosted: Thu Feb 13, 2014 5:22 pm
by shankar_dh
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.

Re: DB2 Unload using DB2BATCH

PostPosted: Sat Feb 22, 2014 8:33 pm
by rajaranganathan
Hi Shankar,

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


Thanks
Raja.R

Re: DB2 Unload using DB2BATCH

PostPosted: Mon Mar 10, 2014 8:54 pm
by Gandosio

Re: DB2 Unload using DB2BATCH

PostPosted: Tue Mar 11, 2014 1:52 pm
by shankar_dh
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.

Re: DB2 Unload using DB2BATCH

PostPosted: Tue Mar 11, 2014 3:46 pm
by shankar_dh
Please ignore my above post.
I have re posted by changing by problem description.

db2/topic9815.html