MDFILCHK - check file extent use and automate recovery
This program is for a mvs3.8j system. It's purpose is to check the space allocated to a dasd dataset to see if the dataset needs maintenance... and will allow multiple ways for automatic maintenance of the dataset.
It permits checks on
- sysin card controlled extents used by a file, some of the system datasets need maintenance as soon as they use a second extent, but user datasets are not a problem until 14-15 extents
- sysin card controlled percentage used by a dataset, some you may want to automate action on at 50% some at 90%
If a file being checked is above the threshold being checked it allows automatic handling of the condition.
-
As shipped this code will depending on the options used in the SYSIN card deck
- use svc34 to issue a console start task command "S AOMTASK,J=member" to
handle the issue.
The start task command is based on my existing on demand job submission procedure which is just to start a proc that submits a member from a dataset as a batch job... as such the sysin card needs a member name in the source currently provided, feel free to replace that logic with your own solution.
The main benefit of my solution is that a seperate batch job member can be used for each dataset being checked so even the most tricky dataset to handle can have a customised recovery job, and they can all be run manually as needed also. - issue a NRD WTO MDFC001A to indicate action is required, the WTO contains the dataset dsorg (PO/PS) and extents used so a message automation rule can handle the issue; rather than needing a job per dataset test as in the above method
- issue a NRD WTO with a different message number to the above, MDFC002A, to indicate action is required but by using a different message number my message automation rules can ignore it. Required for datasets that need attention but require an IPL after they have been sorted out so must be fixed without automation... but still need a NRD message so it gets noticed
- use svc34 to issue a console start task command "S AOMTASK,J=member" to
handle the issue.
JCL and SYSIN cards required to run the program
The SYSIN data card format is fully documented in the soure code. At the end of the source file provided there is also a test step that of course has valid (and deliberately invalid for testing errors) examples; plus of course the required JCL to run the program.
Apart from the SYSIN DD there is an optional (but recomended) REPORT DD that should be used in the JCL to provide information on the current size of the datasets being checked; as you are presumably checking important datasets you know are growing in size this will let you know how fast they are growing in case you do not want to rely 100% on automation and fix in advance.
Program Source
If you think this may be useful to you this is the latest source code being used to test new features. The latest stable version is in my github repository.
Output from the test step
Syslog
Data card errors and missing datasets are WTOed to the console, this ensures error messages are still viewed even if the optional REPORT DD card is not provided in the JCL.
Also if any of the cards trigger the console command to start a job sumbission that is also always logged to the console, as syslog should always be able to prvide an audit trail.
$HASP100 MARKA ON READER1 ASSEMBLE IEF677I WARNING MESSAGE(S) FOR JOB MARKA ISSUED $HASP373 MARKA STARTED - INIT 1 - CLASS A - SYS MID1 IEFACTRT - Stepname Procstep Program Retcode MARKA ASMLKD ASM IFOX00 RC= 0000 MARKA ASMLKD LKED IEWL RC= 0000 *MDFC001A EXT= 4 ORG=PS DS=MARK.LOG.BKPHIST *MDFC001A PCT=73 ORG=PS DS=MARK.LOG.BKPHIST MDFC007W IGNORED:DELIBERATE.BAD.CARD MDFC007W IGNORED:DELIBERATE.BAD.NOT.EXTORPCT MDFC009W DATASET NOT FOUND, MARK.MISSING.DATASET *MDFC001A PCT=66 ORG=PO DS=PL360.SOURCE MDFC010I ISSUING S AMOTASK,J=TESTJOB $HASP100 AOMTASK ON STCINRDR $HASP373 AOMTASK STARTED MARKA TEST0001 MDFILCHK RC= 0000 $HASP395 MARKA ENDED
The REPORT DD
The report DD card is optional; it does however replace all previous debugging options by providing all the required dataset information for each dataset being checked; so if a check does not work as expected you can see what the program thought the dataset size was from the report.
If the report DD card is not provided no error or warning is produced. It is assumed you do not want the report so it is not an error condition.
EXTS TRKS TRKS PCT TEST TEST DSET DATASET NAME USED USED ALLOC USED VAL TYPE ORG ============================================ ==== ===== ===== ==== ==== ==== ==== MARK.LIB.JCL 1 6 20 30 90 PCT PO MARK.LIB.LOAD 1 23 50 46 10 EXT PO MARK.LOG.BKPHIST 4 117 160 73 2 EXT PS ==> EXT > 2 : ALERT WTO ISSUED MDFC001A MARK.LOG.BKPHIST 4 117 160 73 20 PCT PS ==> PCT > 20 : ALERT WTO ISSUED MDFC001A MARK.LOG.BKPHIST **** INVALID DATA CARD **** MARK.LOG.BKPHIST **** INVALID DATA CARD **** MARK.MISSING.DATASET **** DATASET NOT CATALOGUED **** SYS9.LINKLIB 1 42 120 35 1 EXT PO SYS9.LINKLIB.APFAUTH 1 28 150 18 1 EXT PO PL360.SOURCE 1 8 3 66 10 PCT PO ==> PCT > 10 : ALERT WTO ISSUED MDFC001A MARK.LOG.BKPHIST 4 117 160 73 2 EXT PS ==> EXT > 2 : COMMAND ISSUED: S AOMTASK,J=TESTJOB
Alternative similar programs
If you want a program that will scan all online dasd to check for dasd free space plus check space used for all datasets on the online dasd (but with no automation, just reporting) then you might want to look at my DASDSCAN program also available on this site. It is not selective on target datasets, it will just report on all datasets on all online dasd.