Delete a flat file in JCL.

JES2/3, JCL, utilities.
Previous topicNext topic

Topic Author
Shahid
Registered Member
Posts: 43
Joined: Sun Aug 25, 2013 1:00 am

Delete a flat file in JCL.

Post by Shahid » Sun Oct 15, 2017 2:01 pm

How can we delete a flat file in JCL? What utility should we use?




enrico-sorichetti
Global Moderator
Global Moderator
Posts: 887
Joined: Wed Sep 11, 2013 3:57 pm

Re: Delete a flat file in JCL.

Post by enrico-sorichetti » Sun Oct 15, 2017 5:27 pm

does

Code: Select all

... DISP=(OLD,DELETE) 
hint anything ?


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 8-)

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1375
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Delete a flat file in JCL.

Post by Robert Sample » Sun Oct 15, 2017 5:56 pm

Most programmers use IEFBR14 to prevent unexpected side effects.




Topic Author
Shahid
Registered Member
Posts: 43
Joined: Sun Aug 25, 2013 1:00 am

Re: Delete a flat file in JCL.

Post by Shahid » Thu Oct 19, 2017 6:09 pm

Thanks. So can I use any program and just use DISP=(OLD,DELETE)?




nicc
Global Moderator
Global Moderator
Posts: 593
Joined: Wed Apr 23, 2014 8:45 pm

Re: Delete a flat file in JCL.

Post by nicc » Thu Oct 19, 2017 6:20 pm

That would depend on what you and why you are trying to delete. I would not use your bill writing program simply to clean up a few stray dtat sets - you do not want the bills except at bill production time. To simply delete datasets use, as has been suggested, IEFBR14 because it is a program that does nothing - it starts and it then ends. Nothing more. Your JCL statements are actioned by the operating system - not by the program.


Regards
Nic

Previous topicNext topic

Return to “JCL - Job Control Language.”