View previous topic :: View next topic
|
Author |
Message |
kapil dev arora
New User
Joined: 29 Dec 2008 Posts: 37 Location: india
|
|
|
|
Hi,
For example, if a JCL Step is trying to delete 10 DD's out of which 5 are not present, it should delete 5 available DD's and should not abend for other 5 migrated or unavailable datasets.
Thanks,
Kapil. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
if the system has been properly setup ... the job will not abend
it will produce a JCL error if some datasets are not found
it will delete the not migrated ones,
depending on the zOS level it will recall and delete or simply delete the migrated ones
thats all that will happen for a properly setup system
anyway I never had an abend because of recalling migrated datasets
for dataset delete anyhow the best approach is an IDCAMS DELETE it will...
DELETE the dataset on primary volumes
HDELETE the migrated ones |
|
Back to top |
|
|
kapil dev arora
New User
Joined: 29 Dec 2008 Posts: 37 Location: india
|
|
|
|
Can we execute the job without JCLERROR for available datasets even if half of the datasets in the JCL step are not available?
In the below step GDG1 and GDG2 are available and GDG11 and GDG22 are not available(They don't have any versions, just base).
Code: |
//CSADEL11 EXEC PGM=IEFBR14,REGION=&RGN
//*
//DD1 DD DSN=ABC.TESTING.GDG1,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD2 DD DSN=ABC.TESTING.GDG11,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD3 DD DSN=ABC.TESTING.GDG2,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD4 DD DSN=ABC.TESTING.GDG22,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
Can we execute the job without JCLERROR for available datasets even if half of the datasets in the JCL step are not available? |
what happened when You tried ? |
|
Back to top |
|
|
kapil dev arora
New User
Joined: 29 Dec 2008 Posts: 37 Location: india
|
|
|
|
DD2 - DATA SET NOT FOUND
- STEP WAS NOT EXECUTED. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Use IDCAMS instead of IEFBR14 and JES. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
In "DISP=&DISP"..."&DISP" changes to what? Telling us that can be of help. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Quote: |
GDG11 and GDG22 are not available(They don't have any versions, just base). |
Akatsukami wrote: |
Use IDCAMS ... |
Not very sure if OP is creating some empty generation(s) already...I forsee some problem(s) using IDCAMS then... |
|
Back to top |
|
|
kapil dev arora
New User
Joined: 29 Dec 2008 Posts: 37 Location: india
|
|
|
|
Quote: |
In "DISP=&DISP"..."&DISP" changes to what? Telling us that can be of help.
|
DISP='(MOD,DELETE,DELETE)',
-----------
There are no versions for the 11 and 22 and are not getting recreated too. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Code: |
//STEP0010 EXEC PGM=IEFBR14
//DD1 DD DSN=HLQ.some.GDG(+1),
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,2),RLSE),
// DCB=(LRECL=??,RECFM=FB)
//* |
works for me, what are you using? |
|
Back to top |
|
|
kapil dev arora
New User
Joined: 29 Dec 2008 Posts: 37 Location: india
|
|
|
|
Code: |
//CSADEL11 EXEC PGM=IEFBR14,REGION=&RGN
//*
//DD1 DD DSN=ABC.TESTING.GDG1,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD2 DD DSN=ABC.TESTING.GDG11,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD3 DD DSN=ABC.TESTING.GDG2,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE
//*
//DD4 DD DSN=ABC.TESTING.GDG22,
// DISP=&DISP,
// UNIT=&UNIT,SPACE=&SPACE |
Here each DD is a base name for which all its version to be deleted( and base should not be deleted). Job needs to run successfully under the condition that even if DD2 and DD4 are not having any versions for its base it shoul run fine and delete all the versions for DD1 and DD3.
I am not sure but the code you pasted is doing it only for one gdg version.
Thanks,
Kapil. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Anuj Dhawan wrote: |
Akatsukami wrote: |
Use IDCAMS ... |
Not very sure if OP is creating some empty generation(s) already...I forsee some problem(s) using IDCAMS then... |
Why? Unless the TS is giving us incorrect or incomplete requirements (which, I grant, happens often enough on these fora that the possibility must be considered), the task is to delete all generations, empty or otherwise, of the specified GDGs, and to not abend if a GDG base with no associated data sets is specified. Will not IDCAMS do just that? |
|
Back to top |
|
|
lokesh vasanthi
New User
Joined: 19 Aug 2005 Posts: 17 Location: Chennai, India
|
|
|
|
Hi Kapil,
In your case before delete step add one more IEFBR14 step which will create the one empty relative generation files for all the GDG bases which needs to be deleted.
So next step you wouldn't get the JCL error for Dataset not found. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Here is some tested JCL:
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG (NAME(DIV.TESTING.GDG1) LIMIT(10) NOSCRATCH)
DEFINE GDG (NAME(DIV.TESTING.GDG2) LIMIT(10) NOSCRATCH)
DEFINE GDG (NAME(DIV.TESTING.GDG3) LIMIT(10) NOSCRATCH)
DEFINE GDG (NAME(DIV.TESTING.GDG4) LIMIT(10) NOSCRATCH)
/*
//STEP2 EXEC PGM=IEBDG
//SYSPRINT DD SYSOUT=*
//FOO DD DSN=DIV.TESTING.GDG1(+1),DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),SPACE=(TRK,(1,1),RLSE),
// UNIT=DISK
//SYSIN DD *
DSD OUTPUT=(FOO)
FD NAME=FIELD1,LENGTH=36,STARTLOC=1,FORMAT=AN,ACTION=RP
CREATE QUANTITY=100,NAME=FIELD1,FILL=X'40'
/*
//STEP3 EXEC PGM=IEFBR14
//BAR DD DSN=DIV.TESTING.GDG3(+1),DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),SPACE=(TRK,(1,1),RLSE),
// UNIT=DISK
//STEP4 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE DIV.TESTING.GDG1 GDG PURGE FORCE
DELETE DIV.TESTING.GDG2 GDG PURGE FORCE
DELETE DIV.TESTING.GDG3 GDG PURGE FORCE
DELETE DIV.TESTING.GDG4 GDG PURGE FORCE
/*
|
- STEP1 creates the GDG bases.
- STEP2 creates a generation of DIV.TESTING.GDG1 with 100 records in it.
- STEP3 creates a generation of DIV.TESTING.GDG3 with zero records in it (indeed, it is not even opened).
- STEP4 deletes the GDG bases and zero or more generations of each data set, as may exist.
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
kapil dev arora wrote: |
There are no versions for the 11 and 22 and are not getting recreated too. |
/RANT ON
When talking about GDS it is important to use the correct terminology, as both version and generation are both valid in terms of a GDS.
It is a well known fact that only one version of a GDS may exist at any one time, however, multiple generations may exist together.
Please learn and use the correct terminology when posting, as using the wrong term can cause confusion and possibly delay a resolution to your problem
/RANT OFF |
|
Back to top |
|
|
|