View previous topic :: View next topic
|
Author |
Message |
nithinlenin
New User
Joined: 06 Feb 2007 Posts: 19 Location: Hyderabad
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
If you've some third party tools like BMCADM, then there is another way as well. |
|
Back to top |
|
|
nithinlenin
New User
Joined: 06 Feb 2007 Posts: 19 Location: Hyderabad
|
|
|
|
no yaar ... have to write a jcl itselff.. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Can you post the complete message?
O. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
You did create DOWLOAD.DATASET before running this didn't you? |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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. |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
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 |
|
Back to top |
|
|
bosalting
New User
Joined: 02 Jun 2007 Posts: 4 Location: Philippines
|
|
|
|
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 |
|
|
|