View previous topic :: View next topic
|
Author |
Message |
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Occupation: Consultant
And you seriously need to ask this question on a forum ??? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Mainframe Skills: Net surfing, discuss on any topic |
|
Back to top |
|
|
nileshyp
New User
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
prasanth_thavva
New User
Joined: 28 Jul 2005 Posts: 86 Location: Chennai
|
|
|
|
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 |
|
|
Heeraj
New User
Joined: 07 Dec 2010 Posts: 16 Location: Bangalore
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|