Link to home
Start Free TrialLog in
Avatar of Enyinnaya
EnyinnayaFlag for United States of America

asked on

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...
SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of giltjr
giltjr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Enyinnaya

ASKER

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
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.
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?
don't go through all that trouble

what happens if you allocate syspunch in the jcl?

//SYSPUNCH DD DISP=...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok