Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

duplicate name when redefine a gdg file after deleted it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: duplicate name when redefine a gdg file after deleted it
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 04, 2008 3:19 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Feb 05, 2008 12:32 am    Post subject: Reply to: duplicate name when redefine a gdg file after dele
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    Post subject: Reply to: duplicate name when redefine a gdg file after dele
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Feb 05, 2008 1:33 am    Post subject: Reply to: duplicate name when redefine a gdg file after dele
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 05, 2008 12:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Redefine SYS1.PROCLIB farhad_evan JCL & VSAM 12 Mon May 22, 2017 10:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us