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
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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