View previous topic :: View next topic
|
Author |
Message |
dharani.nagarajan
New User
Joined: 11 Nov 2010 Posts: 21 Location: India
|
|
|
|
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 |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
You need SELECT authority on the table to do an UNLOAD. |
|
Back to top |
|
|
dharani.nagarajan
New User
Joined: 11 Nov 2010 Posts: 21 Location: India
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
looks a valid DB2 unload statement.
Don't know about BMCunload and which version of BMC youo're running. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
rocky_balboa
New User
Joined: 24 Mar 2010 Posts: 61 Location: Cape of Good Hope
|
|
|
|
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 |
|
|
dharani.nagarajan
New User
Joined: 11 Nov 2010 Posts: 21 Location: India
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
|