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 from imagecopy

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Unload from imagecopy
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    Post subject:
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

Site Director


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

PostPosted: Tue Jan 25, 2011 9:53 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Wed Jan 26, 2011 7:34 am    Post subject:
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    Post subject:
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: 1278
Location: Belgium

PostPosted: Tue Feb 01, 2011 2:58 pm    Post subject:
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

Site Director


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

PostPosted: Tue Feb 01, 2011 8:41 pm    Post subject:
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    Post subject: Reply to: Unload from imagecopy
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    Post subject:
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: 1278
Location: Belgium

PostPosted: Mon Feb 07, 2011 3:45 pm    Post subject:
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    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 Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm
No new posts DB2 Unload format options Susanta DB2 2 Fri Aug 12, 2016 5:42 pm
No new posts DXT unload utility - DVRE0000 mistah kurtz DB2 1 Thu Jul 07, 2016 4:56 pm
No new posts How to suppress retun code of partil ... mkk157 DB2 9 Fri May 27, 2016 6:59 am
No new posts IBMHPU - Tablespace and Imagecopy chaitanya bharath DB2 1 Fri Apr 15, 2016 5:54 pm


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