IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UNLOAD view using DSNUPROC


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bh_arunk

New User


Joined: 03 Oct 2003
Posts: 3

PostPosted: Sun Oct 18, 2009 10:17 pm
Reply with quote

hi, can anyone give me sample code to UNLOAD a VIEW using DSNUPROC ? The VIEW constitues tables from multiple TABLESPACE. I have tried couple of scenarios but in vain.

Any working code would be appreciable.

Thanks in advance.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Oct 18, 2009 11:28 pm
Reply with quote

Quote:
I have tried couple of scenarios but in vain.


not really informative.

what is your sql, what is your sqlcode/error output?
Back to top
View user's profile Send private message
bh_arunk

New User


Joined: 03 Oct 2003
Posts: 3

PostPosted: Sun Oct 18, 2009 11:49 pm
Reply with quote

Q1. Is it possible to UNLOAD the data directly from VIEW using DSNUPROC ? Please note, ABCDEF is a view (containing multiple tablespaces)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Oct 19, 2009 3:07 am
Reply with quote

Hello,

Quote:
Is it possible to UNLOAD the data directly from VIEW using DSNUPROC ?
At the top of the page is a link to "IBM Manuals". Among these are manuals for several releases of DB2. Suggest you spend some time with the manuals for your release.

In the info for UNLOAD, i do not see VIEW mentioned.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Oct 19, 2009 12:12 pm
Reply with quote

UNLOAD is for tablespaces
You can specify TABLE but that is only for specifying a specific table in a segmented tablespace.

also the message : INVALID OPERAND 'ORDER' should have given you a clue that order by is not allowed.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Mon Oct 19, 2009 1:28 pm
Reply with quote

Arun,
You can use DSNTIAUL. Please find more information regarding this in the following link.

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.apsg/rntiaul.htm
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Oct 19, 2009 4:07 pm
Reply with quote

DSNTIAUL is JCL, DSNUPROC is a stored procedure. Two completely different ways of invoking.

Maybe if you stated the actual requirement, we could give an alternative solution.
Back to top
View user's profile Send private message
bh_arunk

New User


Joined: 03 Oct 2003
Posts: 3

PostPosted: Tue Oct 20, 2009 1:47 am
Reply with quote

Hi,

My requirement is to UNLOAD data from a VIEW say ABCD.

View ABCD spans Multiple tables
say table 1, table 2, table 3, table 4.

Table 1, Table 2 belong to the same table space but tables TABLE 3, TABLE 4 belong to a different tablespace.

I was looking for a code that would help me UNLOAD from such a VIEW using DSNUPROC.

Any working is code appriciable.

As already indicated
1. I would also like to know an equvivalent of ORDER BY during the UNLOAD using DSNUPROC.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Oct 20, 2009 12:25 pm
Reply with quote

AFAIK you can not unload a view using UNLOAD
not through DSNUPROC, not through DSNUTILS.


You can (as Srihari Gonugunta suggested) use DSNTIAUL

extract from the manual :

Code:
//UNLOAD  EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 DSN SYSTEM(DSN)
 RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIB81) -
       LIB('DSN810.RUNLIB.LOAD')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=DSN8UNLD.SYSREC00,
//            UNIT=SYSDA,SPACE=(32760,(1000,500)),DISP=(,CATLG),
//            VOL=SER=SCR03
//SYSPUNCH DD DSN=DSN8UNLD.SYSPUNCH,
//            UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
//            VOL=SER=SCR03,RECFM=FB,LRECL=120,BLKSIZE=1200
//SYSIN    DD *
DSN8810.PROJ WHERE DEPTNO='D01'
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts SET PATH in View DDL DB2 2
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top