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

DUPLICATE NAME EXISTS IN CATALOG problem


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

New User


Joined: 22 Jun 2005
Posts: 65
Location: Mumbai

PostPosted: Tue Jun 28, 2011 7:23 pm
Reply with quote

Hi,

I am running a test job which contains lot of steps and repeatitive runs giving me following message "DUPLICATE NAME EXISTS IN CATALOG" for the output files and each time I need to delete the file manually. Could some one suggest me a solution wherein I can clear all the O/P file at the beginiing of the job itself.

Thanks in advance.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 28, 2011 7:27 pm
Reply with quote

Occupation: Consultant

And you seriously need to ask this question on a forum ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 28, 2011 7:29 pm
Reply with quote

Does your site use a product (such as CA-11) to do this? If so, use it.

If not, create a delete step as the first step of your job to delete all the output data sets. If you provide the full definition (DCB, SPACE, etc) with DISP=(MOD,DELETE) then the JCL will work whether or not the output data set exists or not.

Considering the level of this question, you might be better off going to Beginners and Students Forum as the answers there tend to be more geared to your perceived level of expertise.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jun 28, 2011 7:30 pm
Reply with quote

Mainframe Skills: Net surfing, discuss on any topic 36_2_18.gif
Back to top
View user's profile Send private message
nileshyp

New User


Joined: 22 Jun 2005
Posts: 65
Location: Mumbai

PostPosted: Tue Jun 28, 2011 7:35 pm
Reply with quote

y..?? Do consultants does not get issues while running jobs?
Or do they run IEFBR everytime to delete DSN's?

I slightly remember of some option of Restart=F.
Hence needed help.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Jun 28, 2011 7:52 pm
Reply with quote

If you don't have CA-11 or equivalent product then it is not difficult to write an edit macro to scan your JCL and generate a IDCAMS step that deletes all data sets with DISP=(,CATLG). *That's* what a consultant would do.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Jun 28, 2011 7:56 pm
Reply with quote

Hello,

Quote:
Do consultants does not get issues while running jobs?
Yes, we do, but they are typically not beginner issues (while still beginning, one should be cautious not to label themself a consultant).
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Tue Jun 28, 2011 8:53 pm
Reply with quote

nileshyp -

The point is that even before rerunning the job, it should have been obvious that the JCL to allocate datasets would fail, and that therefore either a manual or automated approach to delete them would be required.

You seem to imply that you kept getting the DUPLICATE messages. Getting them the first time can be just an oversight that we all have done. After that, though, a design decision was required. The code to delete datasets is fairly simple, and knowing to do it before the allocate is also fairly obvious.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Jun 28, 2011 9:32 pm
Reply with quote

Here's a bad idea:

After the first run, change your JCL to use DISP=OLD rather than DISP=(,CATLG).

I tried that when I was a rookie many years ago.... I soon learned

icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jun 28, 2011 9:58 pm
Reply with quote

the issue You are facing is pretty old, at least as old as jcl,
fortunately since 1981 ( maybe earlier ) (*) the cbt tape file 183
contains the CLEANUP program, which does just that
when executed as the first step it will scan the control block chain of the job being executed and will delete all the datasets with disp=(NEW,...)
solving in this way all the issues of duplicate cataloged datasets

(*) thats what the stats in the pds for cbt file 183 tell

no jcl changes, just a new step
Code:
//CLEANUP EXEC PGM=CLEANUP

and all Your nightmares will disappear
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Thu Jul 07, 2011 7:56 am
Reply with quote

as per enrico - there will alway be a step which cleans all temporary files in your jcl. i think its standard,. in our shop we have utility call UC11 if you suppy parm as 'P' it will deletes the entry in catalog. so find out what would be the utility used at ur shop. :-)
Back to top
View user's profile Send private message
Heeraj

New User


Joined: 07 Dec 2010
Posts: 16
Location: Bangalore

PostPosted: Thu Jul 07, 2011 1:20 pm
Reply with quote

Hi all,
In my site, we have a Rexx tool to delete catalogued DS. I cannot provide the code. Howeve the logic is
1. Give JEMCHK or JJ or JSCAN(used to validate or check the JCL statements - hope every site is having one).
2. Then issue the tool as a edit macro (invoke the tool) from command line.
It will get the error messges and check for issues like DUPLICATE NAME EXISTS or GDG BASE DOES NOT EXISTS etc. Based on the issue it will do the necessary action (If DS exists it will delete that, GDG base issue, it will Define a base with default values).

Main advantage of this is we can use this for all jobs, else we have to give each job the delete step.

Thanks,
Heeraj R
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Thu Jul 07, 2011 4:54 pm
Reply with quote

No site I have worked at, several, has had JEMCHK, JJ or JSCAN. All sites have used IEFBR14 at the start of job to delete files that are created during the job, should they exist before the job starts (gdgs excepted).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Jul 07, 2011 7:52 pm
Reply with quote

Hello,

Quote:
Give JEMCHK or JJ or JSCAN(used to validate or check the JCL statements - hope every site is having one
Unfortunately, these "scanners" are very often out of date or follow different "rules" than the sort product in use on the system.

If any such tool is available, consider it site-specific and use it with caution. . .
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 Duplicate transid's declared using CEDA CICS 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
Search our Forums:

Back to Top