Solved

How can I get my SYSPUNCH cards into a single file while unloading from DB2 Table?

Posted on 2013-01-22
15
1,325 Views
Last Modified: 2013-03-05
Hello again Gurus,

I was wondering if anyone has a solution for this issue that I want to resolve. Using LISTDEF and the TEMPLATE command I can dynamically write out all dataset including SYSPUNCH with unique names. However, what if I want to write all SYSPUNCH cards into a single file instead of many files? Something tells me it could be done but I just can't think of how to make that happen.

Can anyone suggest a possible solution?

As always, thank you guys...
0
Comment
Question by:Enyinnaya
  • 7
  • 5
  • 3
15 Comments
 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 167 total points
Comment Utility
how about using the same filename in the template for syspunch and have disp set to old?
or just don't use a template for syspunch and allocate it in the jcl using a dd card
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 333 total points
Comment Utility
You might have to make the DISP MOD instead of OLD.  It depends on if DB2 opens/closes the file multiple times or if it is smart enough to just open it once.
0
 

Author Comment

by:Enyinnaya
Comment Utility
momi_sabag, and giltjr, I tried that already - both DISP=OLD and MOD and got this error:  

DSNU1222I   DSNUULND - TEMPLATE PUNCHDS SPECIFIED FOR PUNCHDDN IS INVALID FOR MUMULTIPLE TABLE SPACES
DSNU012I    DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8



And the TEMPLATE is defined as follows:

 //TEMPDD   DD *
 TEMPLATE UNLOADDS
          DSN('OG3.F&SSID..OSCR.D1UNL.&TS..D&DATE(3)..DATA')
          UNIT SYSDA
          DISP(NEW,CATLG,DELETE)
          EXPDL '1999000'
 TEMPLATE PUNCHDS
          DSN('SD1.F&SSID..OSCR.D1UNL.PUNCH')
          UNIT SYSDA
          DISP(MOD,CATLG,DELETE)
          SPACE (1,1) TRK
 //SYSIN DD *
 OPTIONS LISTDEFDD(LISTDD) TEMPLATEDD(TEMPDD)
 QUIESCE LIST SD1LIST
 UNLOAD  LIST SD1LIST
         UNLDDN   UNLOADDS
         PUNCHDDN PUNCHDS

If ony I can use LISTDEF with IEBGENER, I could then append all SYSPUNCH dataset to to one SYSUT2 output dataset.

Anyone have anyother ideas?

Thanks
0
 
LVL 57

Expert Comment

by:giltjr
Comment Utility
If I understand the DB2 manuals correctly the only initial DISP you can have for punch is new.

It looks like you would need to use another step to copy each individual file into a single file.  If you use a GDG for this you could then use IEBGENER to copy all generations into a single file.
0
 

Author Comment

by:Enyinnaya
Comment Utility
giltjr,

Okay, how would you use GDG and IEBGENER to accomplish your suggestion. The tablespace name is variable and many. IEBGENER GDG(0) for every tablespace each time I run the UNLOAD?
0
 
LVL 37

Expert Comment

by:momi_sabag
Comment Utility
don't go through all that trouble

what happens if you allocate syspunch in the jcl?

//SYSPUNCH DD DISP=...
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 333 total points
Comment Utility
Remove the table space name from the GDG name so that all table spaces are part of the game GDG.

Make sure the GDG is empty when you start.

Then SYSUT1 would refer to the base GDG name only.  When you refer to the base GDG name, it will read ALL generations.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:Enyinnaya
Comment Utility
momi_sabq,

You suggestion is what we currrently doing. What we are trying to achieve is to avoid having to go intoeach and every unload/Load job to add or remove a new tablespace or delete a dropped tablespace.
0
 

Author Comment

by:Enyinnaya
Comment Utility
giltjr,

I don't understand what you are telling me. If I could, I would like to write all the tablespace SYSPUNCH cards to only one file or find a clever way to get my JCL to copy each and all punch cards dataset into one file. Your suggestion intriques me and I plan to try that method on Wednesday.
However, can you explain further what you would do to set up the GDG structure? Please some examples will be much helpful. I learn better with examples.

Thank you
0
 

Author Comment

by:Enyinnaya
Comment Utility
gilrjr,

I have tried the GDG suggestion and I got thhis error:
Here's my Template definition for the GDGs:
TEMPLATE UNLOADDS
         DSN('GO1.F&DB(5,4)..OSCR.D1UNL.&TS..DATA')
         UNIT SYSDA
         DISP(NEW,CATLG,DELETE)
         EXPDL '1999000'
TEMPLATE PUNCHDS
         DSN('GO1.F&DB(5,4)..OSCR.D1UNL.LODPUNCH')
         UNIT SYSDA
         DISP(NEW,CATLG,DELETE)
         SPACE (1,1) TRK
         GDGLIMIT(3)




DSNUQUIB - QUIESCE UTILITY COMPLETE, ELAPSED TIME= 00:00:00
DSNUGUTC -  UNLOAD LIST OG1LIST UNLDDN UNLOADDS PUNCHDDN PUNCHDS
DSNUGULM - PROCESSING LIST ITEM: TABLESPACE OG1DDEV1.OG1SCAM1
DSNUGTIS - PROCESSING TEMPDD AS EBCDIC
DSNUULND - TEMPLATE PUNCHDS SPECIFIED FOR PUNCHDDN IS INVALID FOR MULTIPLE TABLE
DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8


If the Template GDG cannot be used, can you show example of how I could use the IEBGENER method.

Thank you
0
 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 167 total points
Comment Utility
try something like
 DSN('GO1.F&DB(5,4).&TS(5,4)..OSCR.D1UNL.LODPUNCH')

so that each tablespace will get a different file
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 333 total points
Comment Utility
Your template name for the GDG is wrong, it should be:

   DSN('GO1.F&DB(5,4)..OSCR.D1UNL.LODPUNCH(+1)')

Notice the(+1) on the end.  This will create a unique generation for each table space, but using a common GDG base name.  Then you can use then you can use IEBGENER:

//S01OF99 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=GO1.Fxxxx..OSCR.D1UNL.LODPUNCH,DISP=OLD
//SYSUT2 DD DSN=SOMENAME.DISP=(,CATLG)

Where xxxx is the 4 positions from &DB(5,4).  Then once you are done, you can delete all of the generations, so that next time you start from scratch.
0
 

Author Comment

by:Enyinnaya
Comment Utility
moni_sabq, giltjr,  Let me clarify what I am trying to accomplish.
Everything you guys gave suggested on tis thread works...I can create a SYSPUNCH dataset using the template whether it is a GDG based dataset or a simple sequential file. I can dynamically create a file (lets call it FILEA) containing all the SYSPUNCH file names that I generated from doing an UNLOAD. THe whole idea is not to have to hard code tablespace name each and everytime a tablespace is added or dropped. I simply read my SYSTABLESPACE, extract the tablespace I am after, build according to the SYSPUNCH naming convention used during UNLOAD, feed this FILEA to SYSUT1 such as the following:

//S01OF99 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=FILEA,DISP=OLD
//SYSUT2 DD DSN=SOMENAME,DISP=(,CATLG)

I want IEBGENER to read FILEA and copy the actual SYSPUNCH contoll statements of each name registered in FILEA to to 1 single file named in SYSUT2. Inorder words merge all files. The contents of FILEA is just a list of files to copy into SYSUT2 and the structure will look like this:

FILEA:
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SCAM1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SCJR1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SDNF1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SGAJ1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SGCT1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SMSR1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SNAK1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SOFC1.PUNCH
DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SGO11.PUNCH

When I tried this method, IEBGENER errors-out with this message:

DATA SET UTILITY - GENERATE
      DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SCAM1.PUNCH
IEB336I       INVALID COMMAND IN COL. 07
      DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SCJR1.PUNCH
IEB336I       INVALID COMMAND IN COL. 07
      DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SDNF1.PUNCH
IEB336I       INVALID COMMAND IN COL. 07
      DD DISP=SHR,DSN=GO1.FDEV1.OSCR.D1UNL.GO1SGAJ1.PUNCH

What do I need to correct the error and make this work.

Thanks
0
 
LVL 57

Accepted Solution

by:
giltjr earned 333 total points
Comment Utility
IEBGENGER does not work that way.  IEBGENER copies the file(s) defined by the DD statement SYSUT1 to the file defined by SYSUT2.  

You might be able to use IDCAMS

You could use
//OUTDD DD DISP=(MOD,DELETE),DSN=SOMEFILENAME
//SYSIN DD DISP=OLD,DSN=INPUT

Where DSN=INPUT contains statements like:

REPRO OFILE(OUTDD) IDS(GO1.FDEV1.OSCR.D1UNL.GO1SCAM1.PUNCH)
REPRO OFILE(OUTDD) IDS(GO1.FDEV1.OSCR.D1UNL.GO1SCJR1.PUNCH)
0
 

Author Closing Comment

by:Enyinnaya
Comment Utility
ok
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Replication has always been one of those technologies that people run scared from. The main reason is usually cost. When you think of replication, your mind drifts to solutions that replicate from one disk frame to another using block level technolo…
By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now