webmaster_jim

Defining and setting SAP variants with AutoSys adapter

Blog Post created by webmaster_jim on Jun 5, 2015

As we have an issue [Support Request 00110032] with SAP jobs using the SAP adapter, also known as the "Unicenter JM Adapter for SAP Configuration", I needed to create test jobs that did nothing for long periods of time.  The issue is a signal 31 after one minute using the default heartbeat setting [Unicenter AutoSys JM Heartbeat Pace].  We were able to alter the duration when the error occurs, but to be sure that the problem won't manifest in a long-running production job, I needed test cases.  The standard programs that had failed would vary in run time, making them poor choices for quality assurance.

 

We have a delay program (see also  Pssst, ABAP Detective, you got a second? | SCN  and Hey, ABAP Detective, you got 10 seconds? | SCN ) that slept for a specific period of time.  I would run a version of it interactively during benchmark testing of new hardware, then look in the SAP workload logs for exact timing.  For this test, I needed to run it from AutoSys using either the auto_r3/autor3v45 or sapjob command line interfaces ("adapters").  Since I wanted different time periods, I needed SAP variants (other people call them parameters or variables).  While I had not done this before, the CA code suite included another command line program that would predefine the variants in the SAP system, allowing me to bypass interactive logins, and leave a repeatable and documented trail of testing.

 

The manual, like many others, leaves much to be desired in concrete example terms.  The options were there, but in an inscrutable prose that prevented me learning which were mandatory, which optional, and which mutually exclusive.  Steps from an AutoSys job definition (JIL) view follow, so others can benefit.

 

And yes, this is the old method. The newer agent plug-in is the future.  Maybe one day I will learn that tool better too.

 

Define the variant:

 

 

insert_job: TA-GLB-ZDELAYVAR-DEV-00   job_type: CMD

command: casapvar +C dev -r ZZCDLY11 -v ZZCDLY-10-SEC -a A -n p_SEC -i I -o EQ -e 10 -m "10 SECONDS"

machine: dev

owner: dev

permission: gx,wx

date_conditions: 0

description: "Set up variant for ZZCDLY11 - 10 seconds"

std_out_file: "> /tmp/$AUTO_JOB_NAME.$AUTOSERV.out"

std_err_file: "> /tmp/$AUTO_JOB_NAME.$AUTOSERV.err"

max_run_alarm: 360

alarm_if_fail: 1

 

 

Define the job to use the variant:

 

 

insert_job: TA-GLB-ZDELAY-DEV-03   job_type: CMD

command: sapjob +C dev -r ZZCDLY11 -v ZZCDLY-10-SEC

machine: dev

owner: dev

permission: gx,wx

date_conditions: 0

description: "Run ZZCDLY11 with variant for 10 seconds"

std_out_file: "> /tmp/$AUTO_JOB_NAME.$AUTOSERV.out"

std_err_file: "> /tmp/$AUTO_JOB_NAME.$AUTOSERV.err"

max_run_alarm: 360

alarm_if_fail: 1

 

 

It runs longer than 10 seconds, so there is overhead to be accounted for if you need the timing to be more precise.

 

 

$ autorep -j TA-GLB-ZDELAY%3 -n

 

Job Name                     Last Start           Last End             ST Run/Ntry Pri/Xit

____________________________ ____________________ ____________________ __ ________ _______

TA-GLB-ZDELAY-DEV-03         06/05/2015 10:28:06  06/05/2015 10:28:21  SU 34390383/1

 

I'd explain the command line variables, but they're in the book - an exercise for the student.

Outcomes