View previous topic :: View next topic
|
Author |
Message |
Nimisha 3
New User
Joined: 12 Feb 2022 Posts: 4 Location: India
|
|
|
|
Hi All,
I am trying to copy the latest (0) and (-1) generations from production gdg to test gdg.
There are around 200 production gdgs for which this has to be done.
Kindly suggest Jcl/Rexx code for this.
If I want to copy all the generations , then can I use IEBGENER ?
Kindly suggest. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3075 Location: NYC,USA
|
|
|
|
Welcome !
For the first task -
You copy current and previous generations , you can write a proc with two steps in it using SORT and for GDG names use symbolics . Write a JCL to call this proc by overriding with GDG names , repeat this proc for rest of the GDGs. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2585 Location: Silicon Valley
|
|
|
|
Hmmm, keep in mind that I never really used GDGs. I only studied them and tried a few things.
I think job one should do this:
copy prod(-1) to test(0)
and job two would be:
copy prod(0) to test(0)
Notice that the target is test(0) for both jobs.
Or can you copy directly to test(-1)?? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 724 Location: Denmark
|
|
|
|
do you copy to new datasetnames?
do you want the same generation number or are G0001V00 and G0002V00 ok? |
|
Back to top |
|
|
Nimisha 3
New User
Joined: 12 Feb 2022 Posts: 4 Location: India
|
|
|
|
Code: |
//ABCD job notify=&sysuid
//mylib jcllib order=(mygdg.pds)
//step01 exec proc=test proc,
// f1=xyz.input.gdg,
// f2=ABC.out.gdg,
// gen0='(+0)'
// gen1='(-1)'
//testproc proc
//st1 exec pgm=sort
//sortin dd dsn=&f1.&gen1, disp=shr
//sortout dd dsn=&f2, disp=(old,keep,delete)
Sort fields =copy
//st2 exec pgm=sort
//sortin dd dsn=&f1.&gen0, disp=shr
//sortout dd dsn=&f2, disp=(old,keep,delete)
Sort fields = copy
|
Kindly suggest whether my understanding is correct.
If any other method, please share[/img]
Coded |
|
Back to top |
|
|
Nimisha 3
New User
Joined: 12 Feb 2022 Posts: 4 Location: India
|
|
|
|
I want to copy last 2 generations of production gdg to test gdg
Kindly suggest |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 724 Location: Denmark
|
|
|
|
in that case just a straight forward IEBGENER should do it, something like:
Code: |
//C PROC PROD=,TEST=
//C1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=OLD,DSN=&PROD.(-1)
//SYSUT2 DD DISP=(,CATLG),DSN=&TEST.(+1),
// UNIT=SYSDA,BLKSIZE=0,LIKE=&PROD.(0)
//C2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=OLD,DSN=&PROD.(-0)
//SYSUT2 DD DISP=(,CATLG),DSN=&TEST.(+1),
// UNIT=SYSDA,BLKSIZE=0,LIKE=&PROD.(0)
// PEND
//*
//D1 EXEC C,PROD=prod.gdg,TEST=test.gdg |
By the way, do remember that JCL must be in uppercase. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Willy Jensen wrote: |
in that case just a straight forward IEBGENER should do it, something like:
Code: |
//C PROC PROD=,TEST=
//C1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=OLD,DSN=&PROD.(-1)
//SYSUT2 DD DISP=(,CATLG),DSN=&TEST.(+1),
// UNIT=SYSDA,BLKSIZE=0,LIKE=&PROD.(0)
//C2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=OLD,DSN=&PROD.(-0)
//SYSUT2 DD DISP=(,CATLG),DSN=&TEST.(+1),
// UNIT=SYSDA,BLKSIZE=0,LIKE=&PROD.(0)
// PEND
//*
//D1 EXEC C,PROD=prod.gdg,TEST=test.gdg |
By the way, do remember that JCL must be in uppercase. |
There are several problems here.- There is no such thing as a -0 relative generation.
- Steps C1 and C2 attempt to create the same data set. Step C2 should copy from relative generation 0 to relative generation +2
- I'm not comfortable using the LIKE parameter. Better to use no DCB and let IEBGENER copy the SYSUT1 DCB attributes to the SYSUT2 DCB.
There is no easy way to copy all generations of a GDG to the equivalent "test" GDG. You pretty much have to use IEBGENER steps, though it should be possible to write a Rexx exec to generate the JCL, which is pretty much what I'd do if I had the task. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 724 Location: Denmark
|
|
|
|
@steve-myers
you are right, it went too fast and should have been tested. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 585 Location: London
|
|
|
|
Fairly simple with DFDSS (ADRDSSU) COPY, or DUMP/RESTORE, especially if only the HLQ needs changing as per below example. (You need to define the target GDG bases before the copy is run)
If the target names have to changed more substantially, e.g. less or more name qualifiers, then you need specific absolute generation numbers i.e. *.GnnnnV00 for source and targets in the RENAMEU pairs. Note each of these pairs and other statements in the SYSIN can't exceed 255. (Yes a pain in the arse IBM)
e.g.
Code: |
RENAMEU( -
(GDGP.NAME1.GnnnnV00 -
TEST.X. NAME1.GnnnnV00 ) -
(GDGP.NAME2.GnnnnV00 -
TEST.X. NAME2.GnnnnV00 ) -
(GDGP.NAME2.GnnnnV00 -
TEST.X. NAME2.GnnnnV00 ) -
ETC...
)
//*
//* COPY GDGP.** DATASETS TO NEW HLQ TEST
//*
//JSTEP010 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY ALLE TGTA(SRC) TGTGDS(ACTIVE) NMC NSC CAT SHR -
TOL(ENQF) OPT(4) -
DS(FDD(FILT)) -
RENAMEU(TEST)
/*
//FILT DD *
INC( -
GDGP.NAME1(0) -
GDGP.NAME1(-1) -
GDGP.NAME2(0) -
GDGP.NAME2(-1) -
ETC...
) - |
If you want to copy all generations you can code GDG.NAME1(*) -
Coded |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1306 Location: Bamberg, Germany
|
|
|
|
Pete Wilson wrote: |
COPY ALLE TGTA(SRC) TGTGDS(ACTIVE) NMC NSC CAT SHR -
TOL(ENQF) OPT(4) - |
I would suggest using TGTGDS(SRC) and remove NMC NSC. Also TOL(ENQF) is enough so that SHR can be omitted here.
Only problem I see so far is identifying the GDSs that are part of a GDG (not DEFERRED or ROLLED-OFF state). |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 585 Location: London
|
|
|
|
Joerg.Findeisen wrote: |
Pete Wilson wrote: |
COPY ALLE TGTA(SRC) TGTGDS(ACTIVE) NMC NSC CAT SHR -
TOL(ENQF) OPT(4) - |
I would suggest using TGTGDS(SRC) and remove NMC NSC. Also TOL(ENQF) is enough so that SHR can be omitted here.
Only problem I see so far is identifying the GDSs that are part of a GDG (not DEFERRED or ROLLED-OFF state). |
TGTGDS(ACTIVE/SRC) in this case is kind of irrelevant as the use of relative generations in the input list means only Active GDS's are selected anyway. Rolled-off or deferred ones cannot be referenced with relative generation numbers.
Why would you not include NMC and NSC? The MGMTCLAS and STORCLAS assignments of the Prod datasets might be completely inappropriate for TEST datasets so better to let ACS re-drive and assign the correct ones. Some rare issues with things like RLS STORCLAS's can be sorted at leisure in the Test environment.
TOL(ENQF) and/or SHR, not really a concern |
|
Back to top |
|
|
Nimisha 3
New User
Joined: 12 Feb 2022 Posts: 4 Location: India
|
|
|
|
Thank you for the solution, but I could not get the rexx code.
Can we directly start writing from RENAMEU and then follow the structure ?
Are there any prerequisite to be followed? |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 585 Location: London
|
|
|
|
This is the correct order for the JCL and SYSIN statements for a DFDSS COPY. The first example just changes the high level qualifier only on all the target names to 'TEST'.
The second example changes each individual target to an individual new name
Code: |
//DSSCOPY JOB 0,CLASS=X,MSGCLASS=0,NOTIFY=&SYSUID
//*
//* COPY GDGP.** DATASETS TO A NEW HLQ 'TEST'
//*
//JSTEP010 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY ALLE TGTA(SRC) TGTGDS(ACTIVE) NMC NSC CAT SHR -
TOL(ENQF) OPT(4) -
DS(FDD(FILT)) -
RENAMEU(TEST)
/*
//FILT DD *
INC( -
GDGP.NAME1(0) -
GDGP.NAME1(-1) -
GDGP.NAME2(0) -
GDGP.NAME2(-1) -
ETC...
) -
//DSSCOPY JOB 0,CLASS=X,MSGCLASS=0,NOTIFY=&SYSUID
//*
//* COPY GDGP.** DATASETS TO NEW NAMES
//*
//JSTEP010 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY ALLE TGTA(SRC) TGTGDS(ACTIVE) NMC NSC CAT SHR -
TOL(ENQF) OPT(4) -
DS(FDD(FILT)) -
RENAMEU( -
(GDGP.NAME1.GNNNNV00 -
TEST.X.NAME1.GNNNNV00 ) -
(GDGP.NAME2.GNNNNV00 -
TEST.X.NAME2.GNNNNV00 ) -
(GDGP.NAME2.GNNNNV00 -
TEST.X.NAME2.GNNNNV00 ) -
ETC...
)
/*
//FILT DD *
INC( -
GDGP.NAME1(0) -
GDGP.NAME1(-1) -
GDGP.NAME2(0) -
GDGP.NAME2(-1) -
ETC...
) -
|
|
|
Back to top |
|
|
|