Joined: 07 Dec 2015 Posts: 2 Location: netherlands
Hi All,
I have a requirement to delete Mainframe files (aging for more than 10 days) from an archive location. Can any one of you please help me here.
How to identify whether the file is aging for more than 10 days ?
I am ready with the following piece. Question is how to make it complete it in terms of mentioning the archive path and how to identify the number of days for which it is aging.
A response from any one of you and I will be extremely thankful to you.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
Terminology is critical since similar terms in IT may mean very different things. When you say "archive path" you are implying a Unix System Services directory since z/OS does NOT have any paths (at least, not for data sets; coupling facilities are a different story but they wouldn't need to be deleted the way you're talking about). And Unix System Services has files whereas z/OS has data sets (files do not necessarily have a record structure whereas data sets are record-based).
If you ARE talking about a Unix System Services directory, investigate the use of skulker. If you are NOT talking about a Unix System Services directory, you have not provided nearly enough information for any answers to make sense. For example,:
- Is data set aging based on create date, last referenced date, or what?
- Using IEFBR14 is probably the worst possible way to delete the data sets.
- Does your site not use HSM for storage management? If so, why are you even bothering with this?
- What is doing the archiving? Could that be used to delete "old" data sets as well?
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
You are not clear -- is there a single archive directory that you know in advance, or are you wanting to remove files of a certain age from any directory? For the former, use skulker in a cron task once a day (cron will allow you to schedule the task when the impact to the system will be minimal). If the latter, you'll need to manually run skulker on the directory. From the Unix System Services Command Reference manual:
z/OS V1R12.0 UNIX System Services Command Reference
SA22-7802-13
|skulker finds files that are candidates for |deletion in directory, based on comparing the file's |access time to the age specified by days_old.
|When you call skulker without any options, |the files that are candidates for deletion are regular files found |using the primaries as shown in the following find command |line:
|