Automate Stratum or DataTracker Batch Jobs Utilizing Memory on an AS/400

The following is an example of AS/400 CLs that will acquire/allocate memory for a dedicated subsystem, run the load processes, and release the memory when completed. The jobs can be set up to run with a job scheduler or from the command line.

Prerequisites to creating the CL

  1. Must have created a dedicated subsystem with the Silvon suggested parameters. The instructions to create this subsystem can be found here.
  2. May need to have SECOFR security to access system commands used in the CL examples. This depends on how your system security was set up.
  3. If the AS/400 has third party auto-tuning turned on, you must create additional commands within the CLs to handle the tuning software.

 

This page contains three sample CLs that together make up an example of a procedure to control the memory usage during the Stratum or DataTracker load process.

They contain names of CLs, libraries, subsystem, share pool, and job queues that are variables that you can change to fit your environment. You may also add any commands that follow your company’s standards. For example, you may want to display break messages.

Sample 1 can be initiated from a scheduler or command line. This sample CL, ‘LOAD1’ will submit the other two sample CLs.

PGM
/* Declare the performance adjustment parameter */
DCL VAR(&PFRADJ) TYPE(*CHAR) LEN(1)

/* Retrieve the performance adjustment current value */
RTVSYSVAL SYSVAL(QPFRADJ) RTNVAR(&PFRADJ)

/* Change the share pool parameters for the share pool attached to the dedicated subsystem.
The SIZE parameter should be set with all available runtime memory up to, but not exceeding 4GB */
CHGSHRPOOL POOL(*SHRPOOL1) SIZE(927000) ACTLVL(1)
PAGING(*CALC)

/* Start the dedicated subsystem */
STRSBS SBSD(DABATCH)

/* Initiate a 5 second delay to give the subsystem time to come up */
DLYJOB DLY(5)

/* Execute a clear pool command to clear all objects from the storage pool. */
CLRPOOL POOL(*SHRPOOL1)

/*Submit the CL that will run the daily Stratum or DataTracker jobs. */
SBMJOB CMD(CALL PGM(STRATUMMOD/LOAD2)) + JOB(DALOADJOB) JOBQ(DABATCH

/* Submit the CL that changes the performance adjustment value back to the original setting and ends the dedicated subsystem. */
SBMJOB CMD(CALL PGM(STRATUMMOD/LOAD3) + PARN(&PFRADJ)) JOB(ENDLOADJOB) JOBQ(DABATCH)

END: ENDPGM

Sample 2 of our example will be submitted by the ‘LOAD1’ CL. This sample, ‘LOAD2’, will contain the commands to execute the actual load process, such as the daily Stratum or DataTracker loads.

PGM
/* This is the CL that would execute the daily Stratum or DataTracker process */
SNDPGMMSG MSG('THIS IS THE IMPORT/LOAD JOB') TOPGMQ(*PRV)

END: ENDPGM

Sample 3 will also be submitted by the ‘LOAD1’ CL. This sample CL, ‘LOAD3,’ will reset the performance adjustment back to original value and end the subsystem.

PGM PARM(&PFRADJ)

/* Declare the performance adjustment parameter */
   DCL VAR(&PFRADJ) TYPE(*CHAR) LEN(1)
/* Change the performance adjustment back to original value */
   CHGSYSVAL SYSVAL(QPFRADJ) VALUE9&PFRADJ)
/* End the dedicated subsystem */
   ENDSBS  SBS(DABATCH) OPTION(*CNTRLD)

END: ENDPGM