I struggled with getting some automated orchestration of running a backup job and mounting a tape all unattended. Thanks to this forum for providing insight from other member of how some things worked.
I attached a Linux script and some jcl files that I used to get this to work.
My script is a daily backup job that copies a series of datasets to tapes.
The attached files are:
tapeinit.jcl - this job initializes 7 tapes I used, one for each day of the week. Seems as if aws_TapeInit didn't work so I had to do it this way. I only ran this 1 time to get the initial set of tapes. I had to do manual awsmount commands "awsmount 580 -u /ibm/z1090/tapes/T00000". one for each tape requested as the job processed the tape inits along with replying with the label names.
DailyBackup.shell - this script runs daily and determines what tape to use based on day of week. It overlays the previous weeks tape file with the initialized one and writes the data to it. (Change the extension to sh. Forum doesn't like sh extensions)
backmon.jcl - this job runs the daily backup. Need to have one for each day of the week. This is Mondays. Match the day and the tape volser. Need to use a userid/password that has access to backup
backup01.proc - this proc does the actual backup. Modify as you need to or use different program to access the tape.
Since a lot of us are not seasoned z/os experts and are just running this for development/testing/training purposes, I hope this is helpful for you.
Thanks.
jmal