Batch activation

Electronic Service Agent™ can be activated in a batch environment. This approach is helpful for customers who have many remote systems and want to send programs from a central site for remote activation.

A sample CL program is provided.

Sample CL Program for batch activation

This sample program refers to the fictitious ABC Company. Any associated references to this fictitious company are for illustration purposes only.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
/********************************************************************/
/* ELECTRONIC SERVICE AGENT SAMPLE BATCH ACTIVATION PROGRAM         */
/********************************************************************/
/*                                                                  */
/* THIS CODE IS PROVIDED AS A SAMPLE AND IS NOT INTENDED            */
/* TO BE SUPPORTED BY IBM. THIS IS SUPPLIED ON AN AS-IS             */
/* BASIS AND IT IS THE RESPONSIBILITY OF THE END USER TO ENSURE     */
/* THE ACCURACY OF THE PROGRAM IN THEIR ENVIRONMENT.                */
/*                                                                  */
/********************************************************************/
/*                                                                  */
/* See the Electronic Service Agent Information Center topics       */
/* for additional requirements, such as authorities and system      */
/* values.                                                          */
/*                                                                  */
/********************************************************************/
PGM
/********************************************************************/
/*                                                                  */
/* The following variables are used to retrieve the possible        */
/* days to be used as input to the CHGSRVAGTA and AUTOPTF and       */
/* parameters.                                                      */
/*                                                                  */
/********************************************************************/
DCL VAR(&DAY1) TYPE(*CHAR) LEN(4)
DCL VAR(&DAY2) TYPE(*CHAR) LEN(4)
DCL VAR(&DAY3) TYPE(*CHAR) LEN(4)
DCL VAR(&DAY) TYPE(*CHAR) LEN(4)
DCL VAR(&DAYS) TYPE(*CHAR) LEN(28) +
VALUE('*WED*THU*FRI*SAT*SUN*MON*TUE')
DCL VAR(&DAYPTR) TYPE(*DEC) LEN(1 0) VALUE(1)
/********************************************************************/
/*                                                                  */
/* Change the contact information.                                  */
/*                                                                  */
/********************************************************************/
QSYS/CHGCNTINF CMPNY('ABC Company') CONTACT('System +
               Administrator') TELNBR('123-456-7890') +
               MAILADDR('123 ABC Street' *SAME *SAME +
               ANYTOWN MN US 12345) LNGVER(2924) +
               EMAILADDR(SYSADMIN@ABCCOMPANY.COM) +
               MEDPTF(*AUTOMATIC)
/********************************************************************/
/*                                                                  */
/* Configure the Electronic Customer Support and Service Agent      */
/* connections.                                                     */
/* NOTE: THIS SAMPLE ASSUMES A DIRECT CONNECTION FOR THE PRIMARY    */
/*       AND A MULTIHOP CONNECTION FOR THE BACKUP.                  */
/*                                                                  */
/********************************************************************/
QSYS/CRTSRVCFG ROLE(*PRIMARY) CNNTYPE(*DIRECT) +
               CNTRYID(US) STATE(MN)
/*                                                                  */
QSYS/CRTSRVCFG ROLE(*BACKUP) CNNTYPE(*MULTIHOP) +
               RMTSYS('10.11.12.13')
/********************************************************************/
/*                                                                  */
/* Retrieve the days of the week that can be used for CHGSRVAGTA.   */
/*                                                                  */
/* Choose the day that best fits the activity for this system.      */
/* Use the &DAYS variable. The first one is the first choice,       */
/* second one is the second choice, and so on.                      */
/********************************************************************/
QSYS/RTVSRVAGT DAY1(&DAY1) DAY2(&DAY2) DAY3(&DAY3)

DAYLOOP:
IF (&DAY1 *EQ (%SUBSTRING(&DAYS &DAYPTR 4))) THEN(DO)
   CHGVAR VAR(&DAY) VALUE(&DAY1)
GOTO DAYLOOP
ENDDO

IF (&DAY2 *EQ (%SUBSTRING(&DAYS &DAYPTR 4))) THEN(DO)
   CHGVAR VAR(&DAY) VALUE(&DAY2)
GOTO DAYLOOP
ENDDO

IF (&DAY3 *EQ (%SUBSTRING(&DAYS &DAYPTR 4))) THEN(DO)
   CHGVAR VAR(&DAY) VALUE(&DAY)
GOTO DAYLOOP
ENDDO

CHGVAR VAR(&DAYPTR) VALUE(&DAYPTR +4)
GOTO DAYLOOP

ENDDAYLOOP:
/********************************************************************/
/*                                                                  */
/* Configure Service Agent hardware problem reporting using the     */
/* day of the week that was determined above and the desired time.  */
/*                                                                  */
/* -- NOTE: Use this command only if you want to override the       */
/* CHGSRVAGTA defaults.                                             */
/*                                                                  */
/********************************************************************/
QSYS/CHGSRVAGTA ENABLE(*YES) AUTORPT(*YES) AUTOPTF(*YES +
                &DAY *YES) SRVINF((*ALL))

/********************************************************************/
/*                                                                  */
/* Activate Service Agent. If commands CHGSRVAGTA was used ahead of */
/* this, Service Agent will activate using those settings.          */
/* If the command was not used, Service Agent will be activated     */
/* using the defaults.                                              */
/*                                                                  */
/********************************************************************/
SKIPIT: QSYS/STRSRVAGT TYPE(*ACTIVATE)

ENDPGM