John Murray john.ar.murray@gmail.com [hercules-390]
2018-06-11 10:40:10 UTC
Hello. First, my apologies if this is the wrong venue for this. But I am a newbie and Iâm not really sure where I should post stuff.
Iâve written a couple of scripts that make life with zOS and Hercules a bit easier for me. Iâve been playing with Hercules and zOS for a while, but I donât really know my way around the community, so what Iâve built may already be widely available. Apologies for that as well.
My first script, first written in Perl and then rewritten in Python, uses the FTP interface in zOS to submit jobs from your local environment to JES2 and then get the SYSOUT back in a file and display it in an edit session. The command looks like this from the command line:
506> submit.py -h
usage: submit.py [-h] [-d] [-l] [-w seconds] [-u userid] [-p password] [-s hostname] JCLFile
Submit a job to Z/OS, wait for it to end and get the output back
positional arguments:
JCLFile JCL file to submit
optional arguments:
-h, --help show this help message and exit
-d Run the command in debug mode
-l Save the listing file
-w seconds Seconds to sleep before checking for job completion
-u userid Userid to sign-in to zOS with
-p password Password
-s hostname Hostname of host to submit job to
Userid and password will be obtained from environment variables ZOSUSER and
ZOSPSWD if defined. Hostname will be obtained from environment variables
ZOSHOST if defined
I first wrote the script in Windows, where I used to run it in Cygwin, a Unix/Linux work-alike shell. Nowadays I run it unchanged in MacOS.
Like most of you I imagine, I was a mainframe guy (MVS, VM & VSE), in my case, more than a few years ago. I hadnât seen zOS in a couple of decades and then I spent some time at the local IBM lab where I was tasked with finding ways to move data between DB2 running on zOS and DB2 running on LUW. Anyway, when I saw it again I was mostly appalled with the old ISPF UI; I wanted to use Unix (or Linux) and I wanted to be able to use the edit tools I was familiar with (in my case XEmacs). So I started off by writing this script. Again like you, I have more than a few bits of JCL that I use to run processes and discover stuff (IDCAMS, TSO batch, utilities, compilers, etc) and with this script I can prep them in a local editor, submit them and get the SYSOUT back in an easy to read and manipulate environment.
One more script that Iâll share uses the Hercules utilities dasdseq, for displaying sequential datasets, and dasdcat for displaying PDSs. These are great utilities but I can never remember how to use them and, quite honestly, what theyâre called. From the command line:
1176> dasd.py -h
usage: dasd.py [-h] [-d] [-s] [-p PATH] dataset volume
Obtain a sequential or PDS dataset from a zOS volume.
positional arguments:
dataset Dataset and optional members
volume DASD volume (file) dataset is on
optional arguments:
-h, --help show this help message and exit
-d Run the command in debug mode
-s Print a sequential dataset
-p PATH Directory to store listings in
The "s" option indicates that the dataset is seqential.
Use the âsâ option to display sequential datasets. Without the âsâ, the utility assumes that the dataset is a PDS. The âvolumeâ operand is the name (and path) of the DASD file the PDS resides on. The dataset can be specified on itâs own as in:
sys1.proclib
Or with an optional set of members:
sys1.proclib(db2irlm,dsnhpli)
If no members are specified, the script obtains the list of members from the PDS and downloads them as individual files. If a list is specified, the script downloads each of them as individual files. The files are stored in a directory named after the dataset.
Iâve written some other stuff as well, but I havenât played with it in a while so I canât attest to them here. But please let me know if youâd find these utilities useful and Iâll post them online (somewhere).
John Murray
John Murray
2 Avenue de Peterhof
Paris 75017
France
Iâve written a couple of scripts that make life with zOS and Hercules a bit easier for me. Iâve been playing with Hercules and zOS for a while, but I donât really know my way around the community, so what Iâve built may already be widely available. Apologies for that as well.
My first script, first written in Perl and then rewritten in Python, uses the FTP interface in zOS to submit jobs from your local environment to JES2 and then get the SYSOUT back in a file and display it in an edit session. The command looks like this from the command line:
506> submit.py -h
usage: submit.py [-h] [-d] [-l] [-w seconds] [-u userid] [-p password] [-s hostname] JCLFile
Submit a job to Z/OS, wait for it to end and get the output back
positional arguments:
JCLFile JCL file to submit
optional arguments:
-h, --help show this help message and exit
-d Run the command in debug mode
-l Save the listing file
-w seconds Seconds to sleep before checking for job completion
-u userid Userid to sign-in to zOS with
-p password Password
-s hostname Hostname of host to submit job to
Userid and password will be obtained from environment variables ZOSUSER and
ZOSPSWD if defined. Hostname will be obtained from environment variables
ZOSHOST if defined
I first wrote the script in Windows, where I used to run it in Cygwin, a Unix/Linux work-alike shell. Nowadays I run it unchanged in MacOS.
Like most of you I imagine, I was a mainframe guy (MVS, VM & VSE), in my case, more than a few years ago. I hadnât seen zOS in a couple of decades and then I spent some time at the local IBM lab where I was tasked with finding ways to move data between DB2 running on zOS and DB2 running on LUW. Anyway, when I saw it again I was mostly appalled with the old ISPF UI; I wanted to use Unix (or Linux) and I wanted to be able to use the edit tools I was familiar with (in my case XEmacs). So I started off by writing this script. Again like you, I have more than a few bits of JCL that I use to run processes and discover stuff (IDCAMS, TSO batch, utilities, compilers, etc) and with this script I can prep them in a local editor, submit them and get the SYSOUT back in an easy to read and manipulate environment.
One more script that Iâll share uses the Hercules utilities dasdseq, for displaying sequential datasets, and dasdcat for displaying PDSs. These are great utilities but I can never remember how to use them and, quite honestly, what theyâre called. From the command line:
1176> dasd.py -h
usage: dasd.py [-h] [-d] [-s] [-p PATH] dataset volume
Obtain a sequential or PDS dataset from a zOS volume.
positional arguments:
dataset Dataset and optional members
volume DASD volume (file) dataset is on
optional arguments:
-h, --help show this help message and exit
-d Run the command in debug mode
-s Print a sequential dataset
-p PATH Directory to store listings in
The "s" option indicates that the dataset is seqential.
Use the âsâ option to display sequential datasets. Without the âsâ, the utility assumes that the dataset is a PDS. The âvolumeâ operand is the name (and path) of the DASD file the PDS resides on. The dataset can be specified on itâs own as in:
sys1.proclib
Or with an optional set of members:
sys1.proclib(db2irlm,dsnhpli)
If no members are specified, the script obtains the list of members from the PDS and downloads them as individual files. If a list is specified, the script downloads each of them as individual files. The files are stored in a directory named after the dataset.
Iâve written some other stuff as well, but I havenât played with it in a while so I canât attest to them here. But please let me know if youâd find these utilities useful and Iâll post them online (somewhere).
John Murray
John Murray
2 Avenue de Peterhof
Paris 75017
France