Please find a mini Python program to check out your IBM Z Open Automation Utilities installation and explore its possibilities.
Find more information in the IBM documentation.
Be aware of the particular working of passing parameters to a Python program through the command line.
#import logging_config
import sys
from zoautil_py import datasets
# total arguments
n = len(sys.argv)
print("Total arguments passed: ", n)
def printname(dsn):
print("Testing python and IZOAU")
print("Dataset " + dsn + " exists: " + str(datasets.exists(dsn)))
if (n > 2):
print("Pass 1 parameter (dataset name) or less (use default dataset name)")
elif (n==1):
printname("MYDATA.DATASET")
else:
printname(sys.argv[2])
Invoke with:
python testibmzoau.py DATASET.NAME