IWSz - IWSDEFS – Acquiring Scheduling Object Definitions
Use the information in this topic to create datasets on your IWSz scheduler that are required to collect job object definitions to pass onto AAI. The steps here are part of the process of integrating IWSz scheduler instances with AAI using tailored JCLs to extract the data that AAI needs. For information, see IWSz - JCL Samples and Dataset Descriptions.
Job IWSDEFS creates two datasets that contain IWSz scheduling object definitions.
- TWS.IWSC.CONNECT.BATCHL
- TWS.IWSC.CONNECT.BASEOBJS
This page includes the following:
Overview
The job should be scheduled to run once per day, typically in the evening after the majority of scheduling changes are complete for the day.
Each BATCHL dataset should be transferred to the IWSz Connector server with the file name defs and then renamed to defs.<date-time-suffix>, where <date-time-suffix> is the IA of the job performing the transfer. For example, defs.yyyyMMdd.HHmmss.
The BASEOBJS dataset should be transferred with the filename baseobjs and then renamed to baseobjs.<date-time-suffix>, where <date-time-suffix> is the IA of the job performing the transfer. For example, baseobjs.yyyyMMdd.HHmmss.
Step PERIODS in job IWSDEFS invokes a REXX program called IWSPIFPR to export IWSz Period definitions. The sample IWSPIFPR must be tailored to replace IWSz Controller name “IWSC” with the Controller name in your environment. References to the IWSz load module library SEQQLMD0 must also be changed from “TWS.SEQQLMD0” to the appropriate library for your IWSz environment.
The sample IWSDEFS must be tailored to replace IWSz Controller name “IWSC” with your Controller name on lines 19 and 45. References to the IWSz load module library SEQQLMD0 must also be changed from “TWS.SEQQLMD0” to the appropriate library for your IWSz environment.
The sample assumes that the REXX program IWSPIFPR program is located in the library TWS.INST.CUSTOM. Modify the sample to replace TWS.INST.CUSTOM with the library used to store IWSPIFPR on your system.
Example - IWSDEFS
//IWSDEFS JOB ACCNT#,MSGLEVEL=(2,0),NOTIFY=&SYSUID, // MSGCLASS=E //DELETE1 EXEC PGM=IEFBR14 //OLDRPT DD DSN=TWS.IWSC.CONNECT.BATCHL, // UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE) //* //DELETE2 EXEC PGM=IEFBR14 //OLDRPT DD DSN=TWS.IWSC.CONNECT.BASEOBJS, // UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE) //* //DELETE3 EXEC PGM=IEFBR14 //OLDRPT DD DSN=TWS.IWSC.CONNECT.BASEOBJ1, // UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE) //* //DELETE4 EXEC PGM=IEFBR14 //OLDRPT DD DSN=TWS.IWSC.CONNECT.BASEOBJ2, // UNIT=SYSDA,SPACE=(TRK,0),DISP=(MOD,DELETE) //* //BATCHL EXEC PGM=EQQYCAIN,PARM='IWSC,MSGOFF',REGION=0M //* //SYSPRINT DD SYSOUT=* //EQQMLIB DD DSN=TWS.SEQQMSG0,DISP=SHR //ERREUR DD SYSOUT=* //EQQMLOG DD SYSOUT=* //EQQDUMP DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //AD DD SYSOUT=* //OI DD SYSOUT=* //RG DD SYSOUT=* //BATCHL DD DISP=(,CATLG),DSN=TWS.IWSC.CONNECT.BATCHL, // LRECL=80,RECFM=FB, // SPACE=(CYL,(20,30),RLSE) //EXPORTRG DD SYSOUT=* //SYSIN DD * ACTION=OPTIONS,BL=Y,BLPRT=Y,ERROR=Y; ACTION=LIST,RESOURCE=ADCOM,ADID=*,TYPE=A; ACTION=LIST,RESOURCE=ADCOM,ADID=*,TYPE=G; ACTION=LIST,RESOURCE=RGCOM,RGID=*; //* //ALLOC EXEC PGM=IEFBR14 //NEWBASE DD DSN=TWS.IWSC.CONNECT.BASEOBJS, // UNIT=SYSDA,DISP=(,CATLG),SPACE=(CYL,(20,30),RLSE), // DCB=(RECFM=FB,LRECL=133) //* //BASEOBJ EXEC PGM=EQQYCAIN,PARM='IWSC,MSGOFF',REGION=0M //* //SYSPRINT DD DISP=(,CATLG),DSN=TWS.IWSC.CONNECT.BASEOBJ1, // LRECL=132,RECFM=FB, // SPACE=(CYL,(20,30),RLSE) //EQQMLIB DD DSN=TWS.SEQQMSG0,DISP=SHR //ERREUR DD SYSOUT=* //EQQMLOG DD SYSOUT=* //EQQDUMP DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSIN DD * ACTION=OPTIONS,BL=N,BLPRT=N,ERROR=Y; ACTION=LIST,RESOURCE=CLCOM,CALENDAR=*; ACTION=LIST,RESOURCE=WSCOM,WSNAME=*; ACTION=LIST,RESOURCE=WSVCOM,WSNAME=*. //* //PERIODS EXEC PGM=IKJEFT01,REGION=0M //* //SYSTSPRT DD DISP=(,CATLG),DSN=TWS.IWSC.CONNECT.BASEOBJ2, // LRECL=133,RECFM=FB, // SPACE=(CYL,(20,30),RLSE) //OUTDD DD SYSOUT=* //SYSEXEC DD DSN=TWS.INST.CUSTOM,DISP=SHR //SYSTSIN DD * %IWSPIFPR //* //CONCAT EXEC PGM=IEBGENER //SYSUT1 DD DISP=SHR,DSN=TWS.IWSC.CONNECT.BASEOBJ2 // DD DISP=SHR,DSN=TWS.IWSC.CONNECT.BASEOBJ1 //SYSUT2 DD DSN=TWS.IWSC.CONNECT.BASEOBJS, // DISP=SHR //SYSIN DD DUMMY //SYSPRINT DD SYSOUT=* //* //*%OPC SCAN //*%OPC SETFORM OCDATE=(YYMMDD) //*%OPC SETFORM OCTIME=(HHMM) //* //* //* Add file transfer step to transfer BATCHL and BASEOBJS //* datasets to the definition file directory on IWSz Connector //* Server. //* //* BATCHL dataset should should be transferred with the file //* name definitions.txt and then renamed to definitions-yymmddHHMM.txt, //* where yymmddHHMM is the IA of the job performing the transfer. //* //* BASEOBJS dataset should should be transferred with the file //* name baseobjs.txt and then renamed to baseobjs-yymmddHHMM.txt, //* where yymmddHHMM is the IA of the job performing the transfer. //*
Example - IWSPIFPR
/********************************************************************/
/* This program is used to list all cyclic IWSz periods */
/* using the IWSz Program Interface (PIF). */
/* */
/* The sample uses the services provided by the EQQSTOR routine */
/* shipped in the IWSz load-library. */
/* */
/* Ensure you change the subsystem name in the INIT section */
/* to the name of the controller subsystem in your installation. */
/********************************************************************/
YCOM:
trace off /*?r*/
Address ISPEXEC "LIBDEF ISPLLIB DATASET ID('TWS.SEQQLMD0')"
GETMAIN:
storage_action= Left('GET',8)
storage_area = Left('00000000'x,4)
storage_length= Left('00000008'x,4)
storage_parm = 'storage_action storage_area storage_length'
Address LINKPGM "EQQSTOR" storage_parm
If rc^=0 Then Exit
INIT:
action_code = Left('INIT',8)
resource_code = Left('IWSC',8)
data_area = Left('00000000'x,4)
arg_names = Left(' ',8)
arg_values = Left('00000000'x,4)
comm_block = Left('00000000'x,4)
return_code = Left('00000099'x,4)
parm_list = 'action_code resource_code data_area',
'arg_names arg_values comm_block return_code'
CALL:
Address TSO "ALLOC F(EQQMLIB) DA('TWS.SEQQMSG0') SHR REUS"
Address TSO "ALLOC F(EQQMLOG) DA(*)"
Address LINKPGM "EQQYCOM" parm_list
If return_code^='00000000'x Then Exit
LIST:
action_code = Left('LIST',8)
resource_code = Left('PRCOM',8)
arg_names = Left('PRTYPE',16)
arg_values = storage_area
old_value = Storage(c2x(storage_area),8,Left('*',8))
Address LINKPGM "EQQYCOM" parm_list
If return_code^='00000000'x Then Signal TERM
index=1
call get_name
number = c2d(Storage(d2x(ptr+i+8),4))
NEXT:
Do j=2 to number
index = index + 1
action_code = Left('SELECT',8)
resource_code = Left('PRCOM',8)
arg_names = Left('NEXT',16)
Address LINKPGM "EQQYCOM" parm_list
If return_code^='00000000'x Then Signal TERM
Call get_name
End
RETRIEVE:
Do j=1 to number
action_code = Left('SELECT',8)
resource_code = Left('PR',8)
arg_names = Left('PERIOD',16)
arg_values = storage_area
old_value = Storage(c2x(storage_area),8,Left(periods.j,8))
Address LINKPGM "EQQYCOM" parm_list
If return_code^='00000000'x Then Signal TERM
Call get_data
End
TERM:
action_code = Left('TERM',8)
Address LINKPGM "EQQYCOM" parm_list
If return_code^='00000000'x Then Nop
FREEMAIN:
storage_action= Left('FREE',8)
Address LINKPGM "EQQSTOR" storage_parm
Exit
GET_NAME:
ptr = c2d(data_area)
i = 0
Do Forever
segment = Storage(d2x(ptr+i),8)
If segment = ' ' Then Leave
offset = c2d(Storage(d2x(ptr+i+8),4))
data = Storage(d2x(ptr+offset),96)
periods.index = Substr(data, 1,8)
i = i + 16
End
Return 0
GET_DATA:
ptr = c2d(data_area)
i = 0
Do Forever
segment = Storage(d2x(ptr+i),8)
If segment = ' ' Then Leave
offset = c2d(Storage(d2x(ptr+i+8),4))
data = Storage(d2x(ptr+offset),96)
Say '1 PERIOD SEGMENT'
Say ' --------------'
Say ' PERIOD NAME :' Substr(data, 1,8)
Say ' PERIOD TYPE (A,W,N) :' Substr(data, 10,1)
Say ' PERIOD DESCRIPTION :' Substr(data, 11,30)
Say ' INTERVAL OF CYCLIC PERIOD : ' c2d(Substr(data, 41,4))
intervals = c2d(Substr(data, 45,4))
Say ' NUMBER OF ORIGIN DATES :' intervals
Say ' JCL VARIABLE TABLE NAME :' Substr(data, 67,16)
data2 = Storage(d2x(ptr+offset+96), 6 * 2 * intervals)
k = 0
Do intervals
Say ' ' Substr(data2, k * 6 + 1, 6),
Substr(data2, intervals * 6 + k * 6 + 1, 6)
k = k + 1
End
i = i + 16
End
Return 0