Deployment and Initial Usage

This guide will instruct you how to set up and invoke the Model9 Gravity service from the mainframe, using JCL. The service will transform a Model9 data set backup copy / archive / import into a readable file in the cloud. Once transformed, the readable file can be accessed directly or via data analytics tools.

Using Gravity

Step 1: Prerequisites

Verify that Model9 Cloud Backup and Recovery for z/OS is installed

Model9 is responsible for delivering the data set from the mainframe to the cloud / on-premises storage. The data set is delivered as a backup copy, an archive or imported tape data set, and provides the input to the transform service.

Download z/OS cURL

This free tool will allow you to invoke the transform service from z/OS. If cURL is not installed under /usr/bin, edit line 4 and add the path where the cURL module resides.

Step 2: Copy the following script

Copy the following script to /usr/lpp/model9/gravity-run.sh:

#!/bin/sh
json=$1
url='https://<gravity-url>:<port>/transform'
export PATH=/usr/bin:/bin
export _EDC_ADD_ERRNO2=1
cnvto="$(locale codeset)"
headers="Content-Type:application/json"
echo "Running Model9 Gravity"
output=$(curl -H "$headers" -s -k -X POST --data "$json" $url)
if ! [ -z "$output" ]; then
   echo "Transformation ended with the following output:"
   # If the answer is in ASCII then convert to EBCDIC
   firstChar=$(echo $output | cut -c1)
   if [ "$firstChar" = "#" ]; then
      convOutput="$(echo $output | iconv -f ISO8859-1 -t $cnvto)"
   else
      convOutput=$output
   fi
   echo "$convOutput"
fi
status=$(echo $convOutput | tr -s " " | cut -d, -f1 | cut -d" " -f3)
   echo "Transformation ended with status: $status"
if [ "$status" = '"OK"' ];then
   exit 0
else if [ "$status" = '"WARNING"' ]; then
   exit 4
else
   exit 8
fi
fi

Step 3: Copy the following JCL

Copy the following JCL to a local library, update the JOBCARD according to your site standards:

//M9TRNSFM JOB 'ACCT#',REGION=0M,CLASS=A,NOTIFY=&SYSUID
//EXTRACT  EXEC PGM=BPXBATCH
//STDOUT   DD SYSOUT=*
//STDERR   DD SYSOUT=*
//STDPARM  DD *
SH /usr/lpp/model9/gravity-run.sh
//         DD *,SYMBOLS=EXECSYS
'{
    "input": {
        "name"   : "<DATA-SET>",
        "complex": "group-&SYSPLEX",
        "type": "<BACKUP|ARCHIVE|IMPORT>"
    },
    "output": {
        "prefix"      : "/transform/&LYR4/&LMON/&LDAY",
        "compression" : "none",
        "format"      : "text"
    },
    "source": {
        "url"     : "<URL>",
        "api"     : "<API>",
        "bucket"  : "<BUCKET>",
        "user"    : "<USER>",
        "password": "<PASSWORD>"
    }
}'
/*
//

Step 4: Customize the JCL

Update the object storage details

Copy the following object storage variables from the Model9 agent configuration file:

  • <URL>

  • <API>

  • <BUCKET>

  • <USER>

  • <PASSWORD>

Update the complex name

The "complex” name represents the group of resources that the Model9 agent can access. By default, this group is named group-<SYSPLEX> and it is shared by all the agents in the same sysplex. The transform JCL specifies the default, using the z/OS system symbol &SYSPLEX.

If the default was kept for "complex" in the Model9 agent configuration file, no change is needed

If the "complex” name was changed in the Model9 agent configuration file, change the "complex” in the JCL accordingly.

Update the transform prefix

By default, the JCL will create a transformed copy of your input data set, in the same bucket, with the prefix: /transform/&LYR4/&LMON/&LDAY. The prefix is using the following z/OS system symbols:

  • &LYR4 - The year in 4 digits, e.g. 2019

  • &LMON - The month in 2 digits, e.g. 08

  • &LDAY - The day in the month in 2 digits, e.g. 10 You can change the prefix according to your needs.

Step 5: Choose the data set to be transformed

The data set to be transformed should be a backup copy, an archive or imported tape data set, delivered by the Model9 agent:

  • <DATA-SET> - the name of the data set

  • <BACKUP|ARCHIVE|IMPORT> - if the data set is a Model9 backup, archive or import

To change the attributes of the input and the output, and for a full description of the service parameters, see Service parameters.

Step 6: Run the JCL

Submit the job and view the output. See Service response and log samples for sample output.

Step 7: Access the transformed data

Based on the returned response, the outputName will point to the path inside the bucket where the transformed data resides. See Service response and log samples.

Last updated