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 view using DSNUPROC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: UNLOAD view using DSNUPROC
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: 6968
Location: porcelain throne

PostPosted: Sun Oct 18, 2009 11:28 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Oct 19, 2009 3:07 am    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

http://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    Post subject:
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    Post subject:
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    Post subject:
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    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 REXX to view the PGM or PROC jackzhang75 CLIST & REXX 11 Tue Jun 20, 2017 1:20 am
No new posts How to see VIEW definition from BMC c... rohanthengal DB2 1 Thu May 04, 2017 1:50 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm


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