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

Unload from imagecopy


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

New User


Joined: 11 Nov 2010
Posts: 21
Location: India

PostPosted: Tue Jan 25, 2011 4:12 pm
Reply with quote

Hi,

My requirement is to unload data from a imagecopy file. I dont have access to the db2 table, but have access to the image copy file.

Below is unload control card

UNLOAD TABLESPACE DBNAME.TSNAME FROMCOPY
<IMAGECOPY FILE NAME>
PUNCHDDN SYSPUNCH UNLDDN SYSREC

This gives me syntax error.

Can you please help me solving this or Can I get any sample JCL's for this requirement

Thanks,
Dharani
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Jan 25, 2011 7:27 pm
Reply with quote

First, check the syntax for UNLOAD statements in the DB2 Utility Guide in the list af manuals found in the top bar of this site.

Secondly, be sure to document the syntax error and messages in your posting if you want further help from the community on the issue.
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: Tue Jan 25, 2011 9:53 pm
Reply with quote

Hello and welcome to the forum,

Quote:
This gives me syntax error.
Do not post "it didn't work" as this is a complete waste of time. . .

In addition to the "control card" you need to post the jcl used as well as the diagnostic information generated. When you show what has actually happened, we can then help.

Quote:
Can I get any sample JCL's for this requirement
Your jcl will be site-specific, but we should be able to help you with your jcl.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Jan 26, 2011 7:34 am
Reply with quote

You need SELECT authority on the table to do an UNLOAD.
Back to top
View user's profile Send private message
dharani.nagarajan

New User


Joined: 11 Nov 2010
Posts: 21
Location: India

PostPosted: Tue Feb 01, 2011 1:09 pm
Reply with quote

Hi Dick,

Please find the JCL below. Sorry for not being specific.

//STEP05 EXEC BMCUNLD,
// SSID=SSID,
// SYSDB2=SUBSYS,
// UTILID=UNLDTBL1,
// RESTART='NEW/RESTART',
// SOUT='*',
// SORT05='CYL,300'
//*

//SYSIN DD *
UNLOAD TABLESPACE DBNAME.TSNAME FROMCOPY
<IMAGECOPY FILE NAME>
PUNCHDDN SYSPUNCH UNLDDN SYSREC

/*
//SYSREC DD DISP=(NEW,CATLG,DELETE),
// UNIT=VTAPE,
// DCB=BUFNO=40,
//* LABEL=RETPD=42,
// DSN=TEST.BKUP.TABLEUNLD.FEB01
//*
//SYSPUNCH DD DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// DCB=BUFNO=40,
// SPACE=(TRK,(10,100),RLSE),
// DSN=TEST.BKUP.SYSPUNCH.FEB01
//*

Thanks,
Dharani
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Feb 01, 2011 2:58 pm
Reply with quote

looks a valid DB2 unload statement.
Don't know about BMCunload and which version of BMC youo're running.
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: Tue Feb 01, 2011 8:41 pm
Reply with quote

Hello,

Possibly i am having a "bad vision day", but i do not see the diagnostic info. . . To repeat:
Quote:
as well as the diagnostic information generated
Back to top
View user's profile Send private message
rocky_balboa

New User


Joined: 24 Mar 2010
Posts: 61
Location: Cape of Good Hope

PostPosted: Tue Feb 01, 2011 9:52 pm
Reply with quote

I doubt that 'FROMCOPY' is a keyword supported by BMC. Fo unloading from imagecopies you need to specify INFILE IMAGECOPY. For eg(untested)
UNLOAD INFILE IMAGECOPY
SELECT *
FROM AAA.EMP WHERE SSN > 'xxxxxxxxxxx'
ORDER BY HIRE_DATE DESC, EMPL_LNAME

Keep in mind this syntax uses the latest image copy registered in SYSCOPY table...... If you have your own image copies(recovery datasets) you need to use ddname option.....

and your requirement needs to be really specific..... what kind of image copy you want to use FULL/INCREMENTAL..... the SHRLEVL options you are using.....
Back to top
View user's profile Send private message
dharani.nagarajan

New User


Joined: 11 Nov 2010
Posts: 21
Location: India

PostPosted: Mon Feb 07, 2011 2:58 pm
Reply with quote

Hi,

This is the JCL I'm using for unload from imagecopy.

//UTIL EXEC DSNUPROC,SYSTEM=SSID,UID='UNLOAD'
//ULDDDN DD DSN=UNLOAD.DATASET,DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE) DCB=MODEL
//PNHDDN DD DSN=UNLOAD.PUNCH,DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(5,5),RLSE) DCB=MODEL
//SYSIN DD *
UNLOAD TABLESPACE DBNAME.TBNAME
FROMCOPY <Image copy dataset name>
PUNCHDDN PNHDDN UNLDDN ULDDDN
/*

The error messages are

1DSNU000I 038 04:13:09.58 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = UNLOAD
DSNU1044I 038 04:13:09.61 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I 038 04:13:09.61 DSNUGUTC - UNLOAD TABLESPACE <DBNAME.TSNAME>
DSNU1253I -DB2U 038 04:13:09.66 DSNUULIA - USER <USERID> DOES NOT HAVE SELECT PRIVILEGE
ON TABLE <TABLE NAME>, IN TABLESPACE <DBNAME.TSNAME>
DSNU012I 038 04:13:09.67 DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8

Actually I do not have access to the table or tablespace. I only have access to the Imagecopy dataset.

The image copy is a FULL imagecopy. Below is the copy card used to take the imagecopy

LISTDEF COPYLIST
INCLUDE TABLESPACE DBNAME.TSNAME>
TEMPLATE COPYTMPL
DSN('Image copy dataset')
UNIT(SYSDA)
DATACLAS DB2IMAGE
COPY LIST COPYLIST FULL YES SHRLEVEL CHANGE COPYDDN(COPYTMPL)

Can you please help in getting the image copy unload.

Thanks all for your help.

Thanks,
Dharani
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Feb 07, 2011 3:45 pm
Reply with quote

When you are not authorized to select from the table, DB2 will not allow you to see the contents of the table or its imagecopy.
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 changing defaults in db2 admin - Unlo... DB2 0
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top