db2 unload via template



IBM's flagship relational database management system

db2 unload via template

Postby p19689 » Wed Feb 22, 2012 2:06 pm

I'm trying to setup a ad-hoc job to unload subset of tables (200) via a template in to a partition dataset using DB2 utility(DB2 v9 z/os). I would like to assign tablespace name as the member name on PUNCHDDN on a partition dataset.

Find it difficult to get the syntax right. ( Afterward I will copy those PUNCHDDN members to a sequential dataset and run the load as a single job on the target environment)

TEMPLATE PUNCHDS DSN '&USERID..TEST.&DB.(&TS.) '
UNIT SYSDA DISP (NEW,CATLG,DELETE)
SPACE (1,1) CYL

What's wrong with the above dataset allocation for a partition dataset.
p19689
 
Posts: 65
Joined: Fri Oct 01, 2010 1:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: db2 unload via template

Postby BillyBoyo » Thu Feb 23, 2012 9:27 pm

No directory space.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: db2 unload via template

Postby p19689 » Fri Feb 24, 2012 7:15 pm

Thanks Billyboyo, I had added directory space but still had the msg invalid template. Is it possible to define PDS via a template pl ?

TEMPLATE PUNCHDS DSN '&USERID..TEST.SYSPUNC(&TS.) '
UNIT SYSDA DISP (NEW,CATLG,DELETE)
SPACE (1,1) DIR(1) CYL
p19689
 
Posts: 65
Joined: Fri Oct 01, 2010 1:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: db2 unload via template

Postby BillyBoyo » Fri Feb 24, 2012 10:25 pm

I don't know what the default DCB would be, maybe recfm=u? You're going to have to show us the message.

Thinking about it, I'm not certain you can define a PDS with a reference to a member at the same time. To put it another way, I don't think you can. Look up the message. If you think it might help, pre-allocate the PDS, and remove everything except DSN and DISP, which you change to OLD.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: db2 unload via template

Postby p19689 » Sun Feb 26, 2012 4:53 pm

Thanks , I tried preallocating the PDS but had the same error 'INVALID QUALIFIER PUNCH(tablespacename TEMPLATE PUNCHDS ' .

Template used:
TEMPLATE PUNCHDS DSN 'Y#LJYR.TEST.PUNCH(&TS.)'
DISP (OLD,KEEP,KEEP)

Is this impossible to do ? I have seen before that some people had mentioned they use this method to unload many tables from the source and merge the SYSPUNCH and run as a single unload jon in the target environment. That's what I thought of give a try, if possible it's very efficient method.
p19689
 
Posts: 65
Joined: Fri Oct 01, 2010 1:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: db2 unload via template

Postby BillyBoyo » Sun Feb 26, 2012 5:37 pm

I guess you need to look up the message and see what it is telling you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post