0

I am working in a environment where Batch jobs which triggers in daily basis are A to Z– total 24 jobs(Just an example)

All these jobs create QUESTION.XXXXXXXX.HELPME.G0002V000 (Where XXXXXXX=Jobnames(A_Z)) once the batch process is completed.

Case1: QUESTION.XXXXXXXX.HELPME.G0002V000 will be deleted automatically if the batch run is completed successfully.

Case2: on the other hand, If the job is failed, we need to delete QUESTION.XXXXXXXX.HELPME.G0002V000 manually.

Since, we are having huge number of batch jobs and plenty of them fail on daily basis. It’s really painful to delete all them every day.

I want to create a system which can help me in deleting all the generation files in one PS file or .txt files(failed jobs GDG generations) in one shot like submitting one JCL or executing one REXX component.

Note: I cant code this in my JCL because of few other constrains.

  • 2
    It sounds like you want the each GDG to be deleted regardless of successful or abnormal completion (Case 1 and Case 2). Why not just use a `&&` temporary file so they go away at the end of job regardless. – Hogstrom Jun 20 '21 at 17:15
  • As Hogstom says, if you delete the GDG no matter what the result of the batch job then you should be using a temporary file. "I cant code this in my JCL because of few other constrains (sic)". #Tell us what they are - there are experienced MF people here and what you think of as constraints may not be. – Steve Ives Jul 06 '21 at 09:26

1 Answers1

0

A couple of options

  1. Use a BackUp-Delete option in DFDSS or what ever it is called now. Has the advantage of creating a backup of whatever is deleted. You can use generics in DFDSS
  2. If you reference the GDG Base QUESTION.XXXXXXXX.HELPME in JCL it will pickup every generation. You can use DISP=(OLD,DELETE) (note if there is no generation you get a JCL error.
  3. Use Rexx to check/delete

To do it in JCL

//  PGM=IEFBR14
//C  DD DSN=QUESTION.XXXXXXXX.HELPME(+1)....
//*
//  PGM=IEFBR14
//D  DD DSN=QUESTION.XXXXXXXX.HELPME,DISP=(OLD,DELETE)
Bruce Martin
  • 10,358
  • 1
  • 27
  • 38