View previous topic :: View next topic
|
Author |
Message |
julian123
New User
Joined: 14 Aug 2006 Posts: 25
|
|
|
|
gdg definition
Code: |
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//GDG01 DD DSN=GDG01,
// DISP=(,KEEP),UNIT=3390,VOL=REF=GDG01,SPACE=(TRK,(0))
//SYSIN DD *
DEFINE GDG (NAME(GDG01 ) SCRATCH LIMIT(03))
/*
|
gdg deletion
Code: |
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE GDG01 GDG PURGE
/*
|
both of them went ok.
but when i redefined the gdg file using the same name, got duplicate name error, how to correct it? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Do a listcat to see what datasets exist for the GDG base pattern |
|
Back to top |
|
|
Mahesh Kumar Muppavarapu
New User
Joined: 25 Jan 2008 Posts: 1 Location: Chennai
|
|
|
|
Try to delete the GDG by giving force option in sysin dd
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE GDG01 GDG FORCE
/*
(or)
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE GDG01 GDG FORCE PURGE
/*
Since you defined the GDG with Scratch option. When you want to delete you need to specify FORCE keyword.
Note : When you are trying to delete a GDG which is Migrated you should not use purge. So you can use FORCE or you can use FORCE and PURGE Simultaneously.
Sometimes when you try to delete a GDG which has empty version then PURGE Will not work. Anyways this may depend upon how you have defined GDG.
Please let me know if you have any question. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
For what reason You are allocating a GDG01 dataset ? |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
This is another possible cause of the problem
You may be having an issue because you are creating a one qualifier GDG (i.e. GDG01). If GDG01 is also a HLQ, there is probably an alias on your system with an identical name. In this case you cannot created a GDG that is identical to the alias. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I just rechecked the original jcl...
the define gdg step allocates without any reason a gdg01 dataset
without cataloging ( volume not SMS managed ) it
the catalog get involved only fo the GDG stuff, both for the define and
the delete
when rerunning the two jobs, its clear ( very clear )
that since the dataset was allocated but not scratched
the job will get a duplicate dataset error |
|
Back to top |
|
|
julian123
New User
Joined: 14 Aug 2006 Posts: 25
|
|
|
|
thank you all for your response.
hi enrico,
you are right, no need to define a ps file (GDG01).
and it caused the duplicate name error.
now the problem is solved. thank you. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Good spot Enrico !!! |
|
Back to top |
|
|
|