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 Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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