Job Deletion.



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Job Deletion.

Postby Vineet » Wed Dec 10, 2014 7:35 pm

Hi All,
I have a query. I am running a job. is there a way, that in the same job I delete the same member. Below is example.

For Example: A.B.C(JOB1). In the member JOB1, I want to add a last step to Delete the member JOB1 i.e. after execution of the job in the PDS => A.B.C member JOB1 should get deleted after the execution of job JOB1.

Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

 

Re: Job Deletion.

Postby enrico-sorichetti » Wed Dec 10, 2014 8:23 pm

You can delete it in any step even the first one
the dataset containing the JCL will be used only for the tiny instant needed by jets to write it to the SPOOL
when You get the message JOB submitted the job will be in the mighty hands of JES and the dataset can be deleted

thats what happens when submitting something within ispf edit/view/browse,
the edit/view/browse windows data is copied to a ISPF work dataset,
and after the submit the dataset will be reused for other things
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Job Deletion.

Postby vern » Wed Dec 10, 2014 8:26 pm

Yes you can, easily. Add a step to delete A.B.C(JOB1) using IDCAMS or TSO DELETE.

However, I guess what you mean but didn't say, is that you want something that works dynamically instead of hardcoded, i.e. the same process works for A.B.C(JOB2) and B.C.D(JOB3) and so on. Correct?
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby Vineet » Wed Dec 10, 2014 8:45 pm

Hi Vern,
My requirement is I want to perfom the DELETE activity when I am running the same job. For example If I am running job "JOB1". I need to add Step @ end to Delete the job 'JOB1'. Afer execution of JOB1 there should not be any Job with Name JOB1 in the PDS: A.B.C(*) for exapmple. By executing IDCAMS utility seperately I can delete JOB1. I don't want this.

Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby Terry Heinze » Wed Dec 10, 2014 8:54 pm

Caution: I haven't tested IDCAMS or TSO DELETE, but DO NOT USE IEFBR14 for the delete, because your entire PDS will be deleted, not just the one member.
P.S. I used the INTRDR as the last step in the 1st job. It submitted the delete job.
Last edited by Terry Heinze on Wed Dec 10, 2014 8:59 pm, edited 1 time in total.
.... Terry
Terry Heinze
 
Posts: 193
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: Job Deletion.

Postby Vineet » Wed Dec 10, 2014 8:59 pm

Is there a way using JCL we can close any PDS?
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby vern » Wed Dec 10, 2014 9:34 pm

Vinnet, let's try again: so you want to delete the member JOB1 in A.B.C, but you don't want to add a step to the JCL of JOB1 to do this. You want "something else" to delete the member when the job has completed processing. Is this right ?
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby vern » Wed Dec 10, 2014 9:36 pm

And no, there is no way of closing a PDS using JCL. The user/job which has opened the PDS (or any other type of dataset) must close and release it.
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby Vineet » Wed Dec 10, 2014 9:56 pm

Hi Vern,
Let me try to explain U my requirement.

1. I am having a job 'JOB1' in PDS A.B.C(JOB1)'.
2. I want to add a step @ the end of JOB1, so that when the Step executes in JOB1, should delete the Member JOB1 from the PDS A.B.C(*).
3. Tried using IDCAM, but job error out with message 'member in use'.

OR is there a way to Close the member JOB1, by running the JOB1.

If any query/concern please do let me know.

Rgd's
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Job Deletion.

Postby steve-myers » Wed Dec 10, 2014 10:18 pm

What about -
//DELJOB  EXEC PGM=IKJEFT01,PARM='DELETE ''A.B.C(JOB1)'''
//SYSTSPRT DD  SYSOUT=*
//HOLDDS   DD  DISP=OLD,DSN=A.B.C
//SYSTSIN  DD  DUMMY
The HOLDDS DD statement will prevent the job from running until everyone has released A.B.C, though that may not be desirable.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Next

Return to JCL