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 EXISTS IN CATALOG problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: DUPLICATE NAME EXISTS IN CATALOG problem
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 28, 2011 7:27 pm    Post subject:
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: 7906
Location: Bellevue, IA

PostPosted: Tue Jun 28, 2011 7:29 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jun 28, 2011 7:30 pm    Post subject:
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    Post subject: Reply to: DUPLICATE NAME EXISTS IN CATALOG problem
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: 641
Location: Whitby, ON, Canada

PostPosted: Tue Jun 28, 2011 7:52 pm    Post subject:
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

Site Director


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

PostPosted: Tue Jun 28, 2011 7:56 pm    Post subject:
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

Active Member


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

PostPosted: Tue Jun 28, 2011 8:53 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Tue Jun 28, 2011 9:32 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jun 28, 2011 9:58 pm    Post subject: Reply to: DUPLICATE NAME EXISTS IN CATALOG problem
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    Post subject: DUPLICATE NAME EXISTS IN CATALOG problem
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    Post subject: Reply to: DUPLICATE NAME EXISTS IN CATALOG problem
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: 1713
Location: UK

PostPosted: Thu Jul 07, 2011 4:54 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jul 07, 2011 7:52 pm    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


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