Enyinnaya
asked on
How can I delete disk files based on names in another file?
Hello all,
I need to delete many files each time I run a particular job.
What I have tried and will like to do is to create a file which contains names of the files that I want to delete.
For example, the input file will look like the following:
Input_File:
GO1.OSCR.D1UNL.GO1DDEV1.GO 1SCAM1.PUN CH,DISP=(O LD,DELETE, DELETE)
GO1.OSCR.D1UNL.GO1DDEV1.GO 1SCJR1.PUN CH,DISP=(O LD,DELETE, DELETE)
GO1.OSCR.D1UNL.GO1DDEV1.GO 1SDNF1.PUN CH,DISP=(O LD,DELETE, DELETE)
GO1.OSCR.D1UNL.GO1DDEV1.GO 1SGAJ1.PUN CH,DISP=(O LD,DELETE, DELETE)
GO1.OSCR.D1UNL.GO1DDEV1.GO 1SGCT1.PUN CH,DISP=(O LD,DELETE, DELETE)
...
I tried the following JCL which ran fine but did not delete the datasets I am interested in:
//JOBCARD
//UTL1000U EXEC PGM=IEFBR14
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=GO1.OGADM31.ATEMPFIL,D ISP=SHR
//SYSIN DD DUMMY
//*
Can anyone suggest a way to accomplish what I need to get done?
I will greatly appreciate any help that I can get.
Thanks
I need to delete many files each time I run a particular job.
What I have tried and will like to do is to create a file which contains names of the files that I want to delete.
For example, the input file will look like the following:
Input_File:
GO1.OSCR.D1UNL.GO1DDEV1.GO
GO1.OSCR.D1UNL.GO1DDEV1.GO
GO1.OSCR.D1UNL.GO1DDEV1.GO
GO1.OSCR.D1UNL.GO1DDEV1.GO
GO1.OSCR.D1UNL.GO1DDEV1.GO
...
I tried the following JCL which ran fine but did not delete the datasets I am interested in:
//JOBCARD
//UTL1000U EXEC PGM=IEFBR14
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=GO1.OGADM31.ATEMPFIL,D
//SYSIN DD DUMMY
//*
Can anyone suggest a way to accomplish what I need to get done?
I will greatly appreciate any help that I can get.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That tells me the data set either does not exist or is not cataloged.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for Enyinnaya's comment #a38831708
for the following reason:
Again thank you
Accepted answer: 0 points for Enyinnaya's comment #a38831708
for the following reason:
Again thank you
ASKER
DELETE GO1.FDBEV1.OSCR.D1UNL.GO1S
IDC3012I ENTRY GO1.FDBEV1.OSCR.D1UNL.GO1S
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEG-42
IDC0551I ** ENTRY GO1.FDBEV1.OSCR.D1UNL.GO1S
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8
Is there something that I am doing wrong here?
Thanks