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
 

 

unload DB2 table to flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
brindha christy

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Wed Oct 08, 2008 12:06 pm    Post subject: unload DB2 table to flat file
Reply with quote

I am using the following JCL to unload DB2 table into a flat file:

//STEP10 EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
//SYSREC00 DD DSN=XYZ.ABC.DB2.UNLOAD3,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//SYSPUNCH DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBXX)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
END
/*
//SYSIN DD *
SELECT * TABLE.TABLENAME
;
/*

I am getting MAXCC 12 with the following message:
READY
DSN SYSTEM(DBXX)
IKJ56500I COMMAND DSN NOT FOUND
READY
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
IKJ56712I INVALID KEYWORD, PLAN(DSNTIAUL)
IKJ56712I INVALID KEYWORD, PARMS('SQL')
READY
END
READY
END

WHat is wrong in my job
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 08, 2008 1:01 pm    Post subject:
Reply with quote

Hello,

It looks like there may one or more libraries missing. You may need to add a steplib.
Back to top
View user's profile Send private message
lc.milani

New User


Joined: 02 Oct 2008
Posts: 1
Location: Italy

PostPosted: Wed Oct 08, 2008 1:51 pm    Post subject:
Reply with quote

Hi, i had the same problem.
you need to define a steplib with the library where the DSN load is.

my jcl:

Code:

//DB2SQL   EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(0,NE)
//STEPLIB  DD DISP=SHR,DSN=DB2P.V7.RUNLIB.LOAD
//         DD DISP=SHR,DSN=DSN.V7.SDSNLOAD
//SYSTSIN  DD *                                     
DSN SYSTEM(DB2P)                                     
 RUN  PROGRAM(DSNTIAUL) -                           
      PLAN(DSNTIAUL)    -                           
      PARM('SQL')                                   
 END                                                 
/*                                                   
//SYSPRINT DD SYSOUT=*                               
//SYSTSPRT DD SYSOUT=*                               
//SYSOUT   DD SYSOUT=*                               
//SYSUDUMP DD SYSOUT=*                               
//SYSPUNCH DD DSN=my.SYSPUNCH,             
//            DISP=(NEW,CATLG,DELETE), etc....             
//SYSREC00 DD DSN=my.file.output,
//            DISP=(NEW,CATLG), etc....
//SYSIN    DD *                                       
SELECT my_field
   FROM mydb.mytable
 WHERE my-conditions
/*



DB2P.V7.RUNLIB.LOAD : here is the DSNTIAUL's load module
DSN.V7.SDSNLOAD: here is the DSN's load module

you must find theme out in your system settings...try asking to db administrators...

Greetings.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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