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
 

 

Copying DB2 table to Flat file

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

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Wed Sep 05, 2007 7:37 pm    Post subject: Copying DB2 table to Flat file
Reply with quote

Need to copy a DB2 table to a flat file.
Used the following job as mentioned in an earlier post

Code:

//STP0100  EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)     
//SYSREC00 DD DSN=DOWLOAD.DATASET,
//         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(DB2S)                                       
 RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')     
 END                                                     
/*                                                       
//SYSIN    DD *                                         
  SELECT * FROM TABLE.NAME
    ;                                                   
/*                                     


It was giving a MAXCC12 saying DSN not found.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 05, 2007 7:56 pm    Post subject:
Reply with quote

If you've some third party tools like BMCADM, then there is another way as well.
Back to top
View user's profile Send private message
nithinlenin

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Thu Sep 06, 2007 10:08 am    Post subject:
Reply with quote

no yaar ... have to write a jcl itselff..
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Sep 06, 2007 10:57 am    Post subject:
Reply with quote

Can you post the complete message?

O.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Sep 06, 2007 2:11 pm    Post subject: Re: Copying DB2 table to Flat file
Reply with quote

nithinlenin wrote:
It was giving a MAXCC12 saying DSN not found.
Which DSN is not found? Post your SYSOUT messages, AS suggested. By the time try using PARM('SQL') instead of PARMS('SQL').
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Sep 06, 2007 5:39 pm    Post subject:
Reply with quote

You did create DOWLOAD.DATASET before running this didn't you?
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Fri Sep 07, 2007 6:26 pm    Post subject: Reply to: Copying DB2 table to Flat file
Reply with quote

Hi

Better you try this job

//jobcard
//*--------------------------------------
//* UNLOAD DEVELOPER DB2 TABLES EXTRACY QUERY
//*--------------------------------------
//*
//UNLD01 EXEC DB@IAUL,DB2ID=DB,SQLPARM=SQL
//SYSPUNCH DD DUMMY
//SYSREC00 DD DSN=DSNNAME
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,50),RLSE),
// UNIT=SYSDA
//SYSIN DD *

Select * from table name

DB2id shold be your db region
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Mon Sep 10, 2007 9:55 am    Post subject:
Reply with quote

Prasanth,
What you have posted may be a site specific thing.. it may not work for OP.

@OP,
In my site only DBAs have previlage to submit a DSNTIAUL JOB. Even for DEV tables.
In such cases I will suggest coding a DSNREXX exec. It will take some time in developing it for first time, but it will be a resuable code and you will learn many new things. icon_smile.gif
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Sep 10, 2007 10:09 am    Post subject: Reply to: Copying DB2 table to Flat file
Reply with quote

Hi ,

Actually the query posted by Nithin do have this DSNTIAUL utility , So he might be having the access to try that one in his shop. I suggested an easier way for doing this .

I don't See a particular benifit in coding coding a DSNREXX exec. May be in your view point it could be a way to learn many new things . Any way let him try and reply icon_biggrin.gif
Back to top
View user's profile Send private message
bosalting

New User


Joined: 02 Jun 2007
Posts: 4
Location: Philippines

PostPosted: Mon Sep 10, 2007 11:21 am    Post subject: Reply to: Copying DB2 table to Flat file
Reply with quote

If you have QMF in your shop, issue the query you want to download in QMF. And then issue an export command to copy the result into a dataset.. This approach works well for me, instead of using UNLOAD jobs.
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
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 19 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


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