Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1468
  • Last Modified:

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

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
Enyinnaya
Asked:
Enyinnaya
  • 7
  • 5
  • 3
6 Solutions
 
momi_sabagCommented:
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
 
giltjrCommented:
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
 
EnyinnayaAuthor Commented:
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
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
giltjrCommented:
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
 
EnyinnayaAuthor Commented:
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
 
momi_sabagCommented:
don't go through all that trouble

what happens if you allocate syspunch in the jcl?

//SYSPUNCH DD DISP=...
0
 
giltjrCommented:
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
 
EnyinnayaAuthor Commented:
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
 
EnyinnayaAuthor Commented:
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
 
EnyinnayaAuthor Commented:
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
 
momi_sabagCommented:
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
 
giltjrCommented:
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
 
EnyinnayaAuthor Commented:
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
 
giltjrCommented:
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
 
EnyinnayaAuthor Commented:
ok
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 7
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now