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

PUNCH-cards only?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 1:06 pm
Reply with quote

Hi,

I've created this "script" (see below) for unloading all tables in our production environment - including PUNCH cards. The intent is to load these in our Demo environment. However, in our Demo environment, there may be new columns in some tables. Therefore:

My question is: If I just wanted to create PUNCH cards using UNLOAD (and not the actual UNLOAD of data), will I have to do this table by table (using LIMIT 0)? It would be fantastic, if I had this option. icon_smile.gif


Another question: When I define the dynamic dataset names (using &DB and &TS) - how do I best avoid allocation errors (dataset already exists) when I run the job the 2nd time and on?


Code:

OPTIONS EVENT (ITEMERROR,SKIP,WARNING,RC4)

LISTDEF LIST1                   
  INCLUDE TABLE bla.blabla

TEMPLATE TUNLDDN                         
UNIT SYSDA                               
DISP(NEW,CATLG,DELETE)                   
SPACE CYL                                 
PCTPRIME 50                               
MAXPRIME 1000                             
DSN('T.UNLOAD.&DB..&TS..DATA');     
                                         
TEMPLATE TPUNCH                           
UNIT SYSDA                               
DISP(NEW,CATLG,DELETE)                   
SPACE(1,1)                               
DSN('T.UNLOAD.&DB..&TS..PUNCH');     
                                         
UNLOAD LIST LIST1
PUNCHDDN TPUNCH                           
UNLDDN TUNLDDN                           
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue May 28, 2013 1:24 pm
Reply with quote

I think you have to do it table by table.

Regarding dynamic dataset names, you can define them as GDG with limit = 1 or any thing.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 1:38 pm
Reply with quote

Thanks for a quick reply!

Is this the place to post suggestions for future enhancements? If so, please add this to your list:

Make it possible to just create PUNCH cards without actually unloading anything.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Tue May 28, 2013 2:00 pm
Reply with quote

Add something like '.D&DT..T&TI' to add date and timestamp to avoid ds allocation errors.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 2:01 pm
Reply with quote

No, &TS is TABLESPACE
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 2:07 pm
Reply with quote

Plus, I will only need ONE dataset for each table - I don't want to keep X number of generations, as this is of course very space consuming.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 2:15 pm
Reply with quote

GDGLIMIT 1 seems to work just as I wanted - thanks again. icon_smile.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue May 28, 2013 5:24 pm
Reply with quote

What I have done is create a WHEN condition that will produce no rows returned.

Something like:

Code:
UNLOAD LIST LIST1
WHEN (LIST = 'X' AND LIST <> 'X')
PUNCHDDN TPUNCH                           
UNLDDN TUNLDDN


See if this works for you.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 6:03 pm
Reply with quote

I tried, but didn't work? I'm on v10 - which version are you on?

Code:
- INVALID OPERAND 'WHEN' FOR KEYWORD 'UNLOAD'
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue May 28, 2013 6:10 pm
Reply with quote

How many tables are you Unloding with this?

After I posted, I noticed, my syntax was for the Unload of a single table, not a List of tables as you are doing.

This approach will not work I do not think.

PS - We are on DB2V9.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue May 28, 2013 6:14 pm
Reply with quote

About 50 icon_smile.gif

With single table syntax, it may be better to code LIMIT 0 instead.
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 Possible to have two sort cards on on... DFSORT/ICETOOL 14
No new posts Dynamic Sortin DD cards SYNCSORT 8
No new posts Query on updating the control cards. DFSORT/ICETOOL 2
This topic is locked: you cannot edit posts or make replies. Query on updating the control cards. JCL & VSAM 2
No new posts Can we merge these two sort cards int... JCL & VSAM 2
Search our Forums:

Back to Top