When an IPL occurs, it was equivalent a VPOLL=RESET, that means that all CSA storage will be freed, affecting all SHARED variables in AMI Ops Automation. To keep a shared variable across IPL the user will need to implement 3 parts:
- First rule that will update the profile variable always that the shared variable is updated.
- Second rule that will recreate the shared variable after an IPL (or VPOOL=RESET) and update with the profile variable value.
- A REXX EXEC that will to the recreate and update the value.
In my example I am using the variables MYVAR1(SHAR) and MYVARP(PROF)
First rule
Add a rule type VAR to fire when MYVAR1 is updated and update the MYVARP variable using QAOVPUT:
Classic Rules:



Rules Management:



Second Rule
Add a JRNL Rule for one of the PAS initialization messages (e.g. PM0010I) to fire and call an EXEC to do a VGET of PROFILE variable MYVARP and then VPUT of a corresponding Shared MYVAR1 with the same value.
REXX EXEC
This code will check if the shared variable MYVAR1 exist. If not, it will get the value of the profile variable MYVARP and create and set value to the new shared variable MYVAR1:
********************************* Top of Data **********************************
/* REXX */
VARNAME = 'MYVAR1'
/* TRY TO VGET SHARED VARIABLE */
"IMFEXEC VGET "VARNAME" SHAR"
IF IMFCC < 8 THEN
DO
"IMFEXEC MSG '.."IMFENAME": SHARED VARIABLE "VARNAME" ALREADY EXIST'"
EXIT 0
END
ELSE
/* TRY TO VGET PROFILE VARIABLE */
"IMFEXEC VGET MYVARP PROF"
IF IMFCC < 8 THEN
DO
"IMFEXEC MSG '.."IMFENAME": VARIABLE "VARNAME" VPUT FROM PROFILE POOL'"
"IMFEXEC VPUT "VARNAME" USING(MYVARP) SHAR"
EXIT 0
END
ELSE "IMFEXEC MSG '.."IMFENAME": VARIABLE "VARNAME" NOT FOUND IN PROFILE POOL'"
EXIT 8
******************************** Bottom of Data ********************************