IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

duplicate name when redefine a gdg file after deleted it


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
julian123

New User


Joined: 14 Aug 2006
Posts: 25

PostPosted: Mon Feb 04, 2008 1:55 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 04, 2008 3:19 pm
Reply with quote

Do a listcat to see what datasets exist for the GDG base pattern
Back to top
View user's profile Send private message
Mahesh Kumar Muppavarapu

New User


Joined: 25 Jan 2008
Posts: 1
Location: Chennai

PostPosted: Mon Feb 04, 2008 7:44 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 05, 2008 12:32 am
Reply with quote

For what reason You are allocating a GDG01 dataset ?
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Feb 05, 2008 1:25 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 05, 2008 1:33 am
Reply with quote

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
View user's profile Send private message
julian123

New User


Joined: 14 Aug 2006
Posts: 25

PostPosted: Tue Feb 05, 2008 11:57 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 05, 2008 12:55 pm
Reply with quote

Good spot Enrico !!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top