SPOOL partitioning exits sample code
This appendix contains sample code for exits 11 and 12 that can be used to control the spool partitioning features on JES2. These features can be useful for users who are looking for a solution to JES2 spool shortage condition or for JES3 users that use the JES3 spool partitioning function during migration from JES3 to JES2.
The spool partitioning allows you to isolate different types of spool data. Isolating spool data in separate partitions can help you improve spool performance, spool recovery procedures, and spool space management.
This appendix includes the following topics:
 
Copyright license and permission to copy: This appendix contains a sample application program in source language that illustrates programming techniques. You might copy, modify, and distribute this sample program in any form without payment to IBM, for the purposes of developing, using, marketing, or distributing application programs conforming to the application programming interface for the operating platform for which the sample program is written. This example has not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of this program.
 
E.1 Sample exits overview
The spool partitioning that is controlled by these samples are based on RACF FACILITY class profiles. These profiles are used to control the users and jobs that can use spool partitioning and the volumes for spooling the sysouts that are produced by these jobs and, if authorized, use more JES2 spool volumes to overflow the sysouts.
Before implementing this exit, you must determine if your installation uses spool partitioning. Your installation uses spool partitioning if FENCE=ACTIVE=YES is specified on the SPOOLDEF initialization statement.
These exits are used as listed in Table E-1.
Table E-1 Comparison of exits 11 and 12
 
Exit 11
Exit 12
Spool partitioning mask
Initializes and resets bits in the mask.
Can be used to define spool partitioning for the job.
Can only reset bits in the mask to allow spool space to be allocated from more spool volumes.
Started to
Allocate spool space for the first time for the job.
Allocate more spool space when JES2 determines that the spools that use the allowed mask of the job must be expanded.
When exit 11 is called for the first time, situations exist that it are called again if the following conditions are met:
The job was not assigned the maximum number of spool volumes (SPOOLDEF FENCE=VOLUMES=nnnn), regardless of whether space is available on the spool volumes from which the job is permitted to allocate space.
The job assigned the maximum number of volumes and no space is available for allocation (that is, the volumes are full, the volumes are not available for allocation, or the volumes do not have affinity for the system).
Exit 12 is taken when JES2 determines that the spools that are using the allowed mask for the job that was set by exit 11 must be updated. The spools that are using the allowed mask are updated in the following situations:
The job is not yet using the maximum number of spool volumes (SPOOLDEF FENCE=VOLUMES=nnnn), regardless of whether space is available on the spool volumes from which the job is permitted to allocate space.
The job is using the maximum number of volumes (CCTFNCNT in HCCT) and no space is available for allocation (that is, the volume is full, the volume is not available for allocation, or the volume does not have affinity for the system) on the spool volumes from which the job is permitted to allocate space.
Defining spool partitions
To define spool partitions that use the sample exits, define the RACF $JES2.SPART.VOL.sysid.volid profiles on class FACILITY and grant READ access to users that you want to use the partition. The partition can be defined by using a partial spool volume name on RACF profile.
Defining spool partition overflow
To provide for instances when a requested spool partition is full, you can specify where each spool partition’s overflow data is sent. To make this specification, use the RACF $JES2.SPART.OVRFL.sysid.volid profiles on FACILITY class and grant READ access to users that you want use these volumes to overflow spool data.
Also, to allow a job to overflow spool data from a partition, you must define a RACF $JES2.SPART.EXT.sysid.jobname profile on class FACILITY and grant READ access to users extend the current partition to volumes on overflow partition.
Defining default partition
If you want to prevent the JES2 from using all of the available spool data, you must define volumes to a default partition by defining a RACF $JES2.SPART.DFLT.sysid.volid profile on class FACILITY. You also must grant READ access to all users that are allowed to use the spool partitioning process that is provided by exits in this sample.
The volumes that are assigned to a default partitions are used only if all primary and overflow volumes become full and the job requires more spool space to processing.
If the volumes on default partition also becomes full, the exit 12 sends a message to the operator requesting to retry the process or cancel the processing of spool partitioning and allocate spool data into unassigned volumes with space available.
Define at least one volume for the default partition to receive data from overflow volumes without affecting the reserved spool space. If you do not define a default partition for the exits, JES2 uses the reserved spool space that is not assigned to the exits as normal processing if all volumes are full.
E.1.1 RACF profiles used by exits
To implement and control spool partitioning functionality, the exits use RACF profiles in the FACILITY class in accordance with the authorization and qualification requirements of the required spooling resources.
The partitioning control that is offered by these exits is based on the job name and type of address space (which differs from the partitioning control that is provided by JES3 based on the job execution class). Therefore, to permit the jobs to use the spool partitioning functionality that is provided by exits, the following profiles must be defined to RACF:
$JES2.SPART.jobtype.sysid.jobname
This profile is used by exit 11 to control by jobnames the users that can use the provided spool partitioning functionality. The following variables are used on this profiles:
 – jobtype: The type of job that is authorized to use the spool partitioning functionality (JOB, TSU, or STC).
 – sysid: The system ID of the MAS member where the spool partitioning functionality is active to the specific job.
 – jobname: The name partial or fully qualified of job authorized to use the spool partitioning functionality that is provided by exits.
$JES2.SPART.VOL.sysid.volid
This profile is used by exit 11 or exit 12 to identify the spool volumes that can be used as partition space to hold the job data that is based on partial or fully qualified volume name. The following variables are used on this profiles:
 – sysid: The system ID of the MAS member where the spool volume is used as available to spool partitioning.
 – volid: The name of the spool volume that can be used as spool space for partitioning the spool data that is requested by a job.
$JES2.SPART.EXT.sysid.jobname
This profile is used by exit 12 to identify when no other space is available on volumes that are used to hold the original spool data to a job if the spool data can be overflowed to other volumes. The following variables are used on this profile:
 – sysid: The system ID of the MAS member where the extra space to the job is provided, if available.
 – jobname: The name of job that can use the spool partitioning overflow process that is provided by the exits when all volumes on the primary spool partition are full.
$JES2.SPART.OVRFL.sysid.volid
This profile is used by exit 11 and 12 to identify the volumes that are available to receive overflow data from jobs that started to write data in a different volume that is full. The volumes that are identified on this profile can be also identified on the original spool partitioning profile. The following variables are used on this profile:
 – sysid: The system ID of the MAS member where the spool volume is used as available to receive spool overflow data.
 – volid: The name of spool volume that can be used as spool space for overflow of original spool data.
$JES2.SPART.DFLT.sysid.volid
This profile is used by exit 11 and 12 to identify the volumes that are available to receive overflowed data from jobs that started to write data in a different volume that are full. The volumes that are identified on this profile can be also identified on the original spool partitioning profile. The following variables are used on this profile:
 – sysid: The system ID of the MAS member where the spool volume is used as available to receive spool overflow data.
 – volid: The name of the spool volume that can be used as spool space for the overflow of original spool data.
$JES2.SPART.CLASS.sysid.jobclass
This profile is used by exit 11 and 12 to control by jobclass definition the users that can use spool partitioning. The following variables are used on this profile:
 – sysid: The system ID of the MAS member where the spool partitioning functionality is active to the specific job.
 – jobclass: The 1 - 8 characters class definition that is authorized to use the spool partitioning functionality that is provided by exits.
Sample profile definitions
How you can implement JES3 spool partitioning and migrate it to JES2 with the sample exits 11 and 12 is shown in Example E-1.
Example E-1 Sample JES3 spool partitioning definitions
SPART,NAME=NORMAL,DEF=YES
SPART,NAME=SPECIAL,OVFL=SPARE
SPART,NAME=SPARE
 
TRACK,DDNAME=SPOOL1,SPART=NORMAL
TRACK,DDNAME=SPOOL2,SPART=NORMAL
TRACK,DDNAME=SPOOL3,SPART=NORMAL
TRACK,DDNAME=SPOOL4,SPART=SPECIAL
TRACK,DDNAME=SPPOL5,SPART=SPARE
 
CLASS,NAME=A,SPART=NORMAL
CLASS,NAME=B,SPART=SPECIAL
SYSOUT,CLASS=X,SPART=NORMAL
SYSOUT,CLASS=Y,SPART=SPECIAL
With the new APAR OA55792 applied, the JES2 supports the use of job class and message class to select the jobs that can use spool partitioning. Because the APAR was not available during the tests, the version that is presented uses the JOBNAME to select the candidate jobs. Also, you must permit special users to use the spool partitioning function, as shown in Example E-2.
Example E-2 Sample RACF profile definitions
$JES2.SPART.jobtype.sysid.jobname
$JES2.SPART.JOB.*.EMG*: Permit special users for processing batch jobs by using spool partitioning.
$JES2.SPART.VOL.sysid.volid
$JES2.SPART.VOL.*.SPOOL1: Permit normal users
$JES2.SPART.VOL.*.SPOOL2: Permit normal users
$JES2.SPART.VOL.*.SPOOL3: Permit normal users
$JES2.SPART.VOL.*.SPOOL4: Permit special users to allocate spool space for batch job processing.
$JES2.SPART.EXT.sysid.jobname
$JES2.SPART.EXT.*.EMG*: Permit special users to acquire more spool space if the primary partition became full
$JES2.SPART.CLASS.sysid.class
$JES2.SPART.*.A*: Permit that jobs running with jobclasses started with A are able to use spool partitioning.
$JES2.SPART.OVRFL.sysid.volid
$JES2.SPART.OVLF.*.SPOOL5: Permit special users to use the spool volume SPOOL5 as overflow space from primary partition.
$JES2.SPART.DFLT.sysid.volid
The following profile definitions permit all users with access to use spool partitioning to allocate space on the spool volume:
$JES2.SPART.DFLT.*.SPOOL1 UACC(READ)
$JES2.SPART.DFLT.*.SPOOL2 UACC(READ)
$JES2.SPART.DFLT.*.SPOOL3 UACC(READ)
 
E.2 Exit 11 program source code
The sample code for JES2X011 exit that is used to provide the spool partitioning process to JES2 is shown in Example E-3.
Example E-3 JES2 exit 11 code sample
TITLE 'JES2 EXIT011 - SPOOL PARTITIONING'
*/*******************************************************************/*
*/* PROGRAM - JES2X011 */*
*/* */*
*/* FUNCTION - THIS EXIT IS DESIGNED TO PROVIDE SPOOL PARTITIONING */*
*/* FUNCTIONS TO JES2 SIMILAR TO JES3 */*
*/* */*
*/*******************************************************************/*
EJECT
PRINT GEN
*/*******************************************************************/*
*/* COPY OF JES2 $HASPGBL MAPPING */*
*/*******************************************************************/*
COPY $HASPGBL
EJECT
*/*******************************************************************/*
*/* JES2 MACRO $MODULE EXPANSION */*
*/*******************************************************************/*
JES2X011 $MODULE ENVIRON=JES2, X
RMODE=ANY, X
IBMJES2=SAMPLE, X
$BUFFER, REQ BY $REQBUF, $FREEBUF X
$CAT, REQ BY HCT X
$CNVWORK, CONV. PROCESSOR PCE WORK1 AREA X
$DAS, IOT MAPPINT MACRO X
$DTE, REQ BY PCE X
$DTECNV, REQ BY DTE X
$ERA, REQ BY DTE X
$HASPEQU, HASP EQUATES X
$HCCT, REQ BY $SAVE, $RETURN, ETC X
$HCT, REQ BY $SAVE, $RETURN, ETC X
$IOT, IOT MAPPINT MACRO X
$JCT, REQ BY CAT X
$JCTX, REQ BY CAT X
$JQE, REQ BY HCT X
$MIT, REQ BY MODEND X
$PADDR, REQ BY HCT X
$PCE, REQ BY HCT X
$SCAT, REQ BY HCT X
$TAB, REQ BY $CNVWORK X
$TRE, REQ BY $JCTXGET X
$TQE, REQ BY $CNVWORK X
$XECB, REQ BY DTE X
$XIT, X
CVT, COMMUNICATION VECTOR TABLE X
DEB, DATA EXTEND BLOCK X
CNMB, CONVERTER MESSAGE BUFFER X
RPL, ACB REQUEST PARAMETER LIST X
SDWA, SYSTEM DIAGNOSIS WORK1ING AREA X
WPL REQ BY $$WTO
*/*******************************************************************/*
*/* JES2 EXIT 11 ENTRY POINT */*
*/*******************************************************************/*
EXIT011 $ENTRY BASE=R12,CSECT=YES
SAVE (14,12)
LR R12,R15
LM R7,R9,0(R1)
USING IOT,R7
USING JCT,R8
USING HCT,R11
L R2,$HCCT
USING HCCT,R2
*/*******************************************************************/*
*/* OBTAIN STORAGE TO VARIABLES USED BY EXIT */*
*/*******************************************************************/*
STORAGE_OBTAIN EQU *
STORAGE OBTAIN,LENGTH=WORKLEN,LOC=31
ST R13,4(R1)
ST R1,8(R13)
LR R13,R1
USING WORKAREA,R13
*/*******************************************************************/*
*/* TEST IF JCT IS PRESENT AND IF THE MAIN CONDITIONS TO PROCESS */*
*/*******************************************************************/*
TEST_EXIT_CALL EQU *
XC RETURN_CODE,RETURN_CODE
LTR R8,R8
BZ END_OF_EXIT
TM JCTUSERB,X'B0'
BO END_EXIT_08
*/*******************************************************************/*
*/* IDENTIFY THE TYPE OF JCT (TSO, JOB OR STC) */*
*/*******************************************************************/*
MVC RACF_JOB_TYPE,RACF_PROF_JOB
TM JCTJOBFL,JCTBATCH
BO VALID_JOB_TYPE
MVC RACF_JOB_TYPE,RACF_PROF_TSU
TM JCTJOBFL,JCTTSUJB
BO VALID_JOB_TYPE
MVC RACF_JOB_TYPE,RACF_PROF_STC
TM JCTJOBFL,JCTSTCJB
BNO END_OF_EXIT
*/*******************************************************************/*
*/* GET USERID AND SYSID TO IDENTIFY THE JOB AND PROCESSING MEMBER */*
*/*******************************************************************/*
VALID_JOB_TYPE EQU *
PERFORM GET_SYSID,R
PERFORM GET_USERID,R
*/*******************************************************************/*
*/* TEST IF FENCE IS ACTIVE TO THIS JES2 MEMBER */*
*/*******************************************************************/*
TM $FLAG1,$MVFENCE
BO GET_REQUESTED_INFO
GETMSG 6,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG6_SYSID-MSG6(L'SYSID),SYSID
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* GET RQQUIRED INFORMATION FROM JCT, IOT AND HCT */*
*/*******************************************************************/*
GET_REQUESTED_INFO EQU *
XC FLAG,FLAG
MVC #SPOOL_VOLUMES,$SPOLNUM
MVC #FENCE_VOLUMES,$FNCCNT
MVC DAS_ADDRESS,$DASAREA
MVC DAS_FIRST,$DASFRST
MVC JOB_NAME,JCTJNAME
MVC JOB_NUMBER,JCTJBNUM
MVC JOB_JOBID,JCTJOBID
MVC JOB_CLASS,JCTJCLAS
MVC SPOOL_ALLOCATED_MASK,IOTSPMSK
MVC SPOOL_AVAILABLE_MASK,CCTVBLOB
XC SPOOL_ALLOWED_MASK,SPOOL_ALLOWED_MASK
XC SPOOL_VOL_SET,SPOOL_VOL_SET
*/*******************************************************************/*
*/* VERIFY IF THE JOBNAME IS A CANDIDATE TO USE SPOOL PARTITIONING */*
*/*******************************************************************/*
VALIDATE_JOBNAME EQU *
CLEAR RACF_PROFILE
MVC RACF_TYPE(L'RACF_PROF_TYPE),RACF_PROF_TYPE
MVC RACF_SPOOLJ(L'RACF_JOB_TYPE),RACF_JOB_TYPE
MVI RACF_SPOOLJ_DOT1,C'.'
MVC RACF_SPOOLJ_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLJ_DOT2,C'.'
MVC RACF_SPOOLJ_JOB(L'JOB_NAME),JOB_NAME
PERFORM RACF_CHECK_AUTH,R
LTR R15,R15
BNZ END_OF_EXIT
OI FLAG,FLAG_JOBNAME
*/*******************************************************************/*
*/* SEND A MESSAGE INDICATING THAT JOB IS VALID CANDIDATE */*
*/*******************************************************************/*
GETMSG 1,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG1_SYSID-MSG1(L'SYSID),SYSID
MVC WTO_MESSAGE+MSG1_JOBNAME-MSG1(L'JOB_NAME),JOB_NAME
MVC WTO_MESSAGE+MSG1_JOBTYPE-MSG1(L'RACF_JOB_TYPE),RACF_JOB_TYPE
PERFORM SEND_WTO,R
MVC SPOOL_VOL_TYPE,VOL_ALLOWED
*/*******************************************************************/*
*/* VALIDATE THE $DAS HEADER ON $IOT DATA AREA */*
*/*******************************************************************/*
START_DAS_VALIDATION EQU *
L R1,$DASAREA
CLC DAS_POOL_ID,0(R1)
BE START_DAS_SEARCH
GETMSG 2,WTO_MESSAGE,MESSAGES
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* START THE $DAS SEARCHING PTOCESS TO FIND SPOOL VOLUMES */*
*/*******************************************************************/*
START_DAS_SEARCH EQU *
L R3,$DASFRST
USING DAS,R3
*/*******************************************************************/*
*/* INITIALIZE VARIABLES AND COUNTERS */*
*/*******************************************************************/*
LA R1,SPOOL_ALLOWED_MASK
ST R1,SPOOL_MASK_ADDRESS
LA R1,SPOOL_AVAILABLE_MASK
ST R1,SPOOL_AVAIL_ADDRESS
XC BITMASK,BITMASK
OI BITMASK,X'80'
LH R4,#SPOOL_VOLUMES
*/*******************************************************************/*
*/* COMPARE THE TOTAL VOLUME ADDED WITH FENCE VALUE */*
*/*******************************************************************/*
NEW_DAS_ENTRY EQU *
CLC SPOOL_VOL_SET,#FENCE_VOLUMES
BNL END_DAS_CHAIN
*/*******************************************************************/*
*/* VALIDATE IF THE SPOOL VOLUME IS AVAILABLE FOR ALLOCATION */*
*/*******************************************************************/*
TM DASFLAG,DASACTIV
BNO NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* TESTS IF THE VOLUME HAVE SPACE AVAILABLE TO BE ALLOCATED */*
*/*******************************************************************/*
L R1,SPOOL_AVAIL_ADDRESS
XR R15,R15
IC R15,BITMASK
EX R15,TEST_BITMASK
BNO NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* GET VOLUME ID FROM $DAS AND CHECK RACF PROFILE ACCESS */*
*/*******************************************************************/*
MVC SPOOL_VOLUME,DASVOLID
PERFORM CHECK_VOLUME_ACCESS,R
PERFORM RACF_CHECK_AUTH,R
LTR R15,R15
BNZ NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* ADD THE SPOOL VOLUME AS A VOLUME ALLOWED TO BE ALLOCATED */*
*/*******************************************************************/*
ADD_SPOOL_VOLUME EQU *
XR R1,R1
IC R1,SPOOL_VOL_SET
LA R1,1(R1)
STC R1,SPOOL_VOL_SET
OI FLAG,FLAG_SPOOL
*/*******************************************************************/*
*/* SET A BIT ON BITMASK TO PUT A VOLUME AS ALLOWED */*
*/*******************************************************************/*
L R1,SPOOL_MASK_ADDRESS
OC 0(L'BITMASK,R1),BITMASK
*/*******************************************************************/*
*/* SEND MESSAGE TO CONSOLE WITH SPOOL VOLUME ADDED TO JOB */*
*/*******************************************************************/*
GETMSG 3,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG3_VOLUME-MSG3(L'SPOOL_VOLUME),SPOOL_VOLUME
MVC WTO_MESSAGE+MSG3_JOBNAME-MSG3(L'JOB_NAME),JOB_NAME
MVC WTO_MESSAGE+MSG3_JOBTYPE-MSG3(L'RACF_JOB_TYPE),RACF_JOB_TYPE
MVC WTO_MESSAGE+MSG3_VOLTYPE-MSG3(L'SPOOL_VOL_TYPE),SPOOL_VOL_TYPE
PERFORM SEND_WTO,R
*/*******************************************************************/*
*/* JUMP TO NEXT AVAILABLE DAS ENTRY ON DAS CHAIN */*
*/*******************************************************************/*
NEXT_DAS_ENTRY EQU *
XR R1,R1
ICM R1,15,DASTRAKQ
LTR R1,R1
BZ END_DAS_CHAIN
LR R3,R1
A R3,$DASAREA
PERFORM NEXT_BITMASK,R
BCT R4,NEW_DAS_ENTRY
*/*******************************************************************/*
*/* CHECK IF WAS SET ANY VOLUME TO BE USED BY JOB AND SET JCTUSER */*
*/*******************************************************************/*
END_DAS_CHAIN EQU *
TM FLAG,FLAG_SPOOL
BNO SEARCH_OVERFLOW_VOLUMES
MVC 0(L'SPOOL_ALLOWED_MASK,R9),SPOOL_ALLOWED_MASK
OI JCTUSERB,X'B0'
B END_EXIT_08
*/*******************************************************************/*
*/* SET TO SEARCH FOR DEFAULT VOLUMES TO BE USED BY JOB */*
*/*******************************************************************/*
SEARCH_OVERFLOW_VOLUMES EQU *
TM FLAG,FLAG_OVERFLOW
BO SEARCH_DEFAULT_VOLUMES
OI FLAG,FLAG_OVERFLOW
MVC SPOOL_VOL_TYPE,VOL_OVERFLOW
B START_DAS_VALIDATION
*/*******************************************************************/*
*/* SET TO SEARCH FOR DEFAULT VOLUMES TO BE USED BY JOB */*
*/*******************************************************************/*
SEARCH_DEFAULT_VOLUMES EQU *
TM FLAG,FLAG_DEFAULT
BO NO_VOLUMES_FOUND
OI FLAG,FLAG_DEFAULT
MVC SPOOL_VOL_TYPE,VOL_DEFAULT
B START_DAS_VALIDATION
*/*******************************************************************/*
*/* SEND MESSAGE WITH NO VOLUMES FOUND CONDITION AND RETURN TO JES */*
*/*******************************************************************/*
NO_VOLUMES_FOUND EQU *
GETMSG 4,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG4_JOBNAME-MSG4(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* POINT TO NEXT BITMAKS TO BE USED FOR SPOOL VOLUME */*
*/*******************************************************************/*
NEXT_BITMASK EQU *
TM BITMASK,X'01'
BO SHIFT_SPOOL_MASK
XR R1,R1
IC R1,BITMASK
SRL R1,1
STC R1,BITMASK
BR R10
*/*******************************************************************/*
*/* WALK THRU SPOOL_ALLOWED_MASK AND SPOOL_AVAILABLE_MASK */*
*/*******************************************************************/*
SHIFT_SPOOL_MASK EQU *
L R1,SPOOL_MASK_ADDRESS
LA R1,L'BITMASK(R1)
ST R1,SPOOL_MASK_ADDRESS
L R1,SPOOL_AVAIL_ADDRESS
LA R1,L'BITMASK(R1)
ST R1,SPOOL_AVAIL_ADDRESS
XC BITMASK,BITMASK
OI BITMASK,X'80'
BR R10
*/*******************************************************************/*
*/* VALIDATE THE SPOOL VOLUME AGAINST RACF PROFILE ACCESS */*
*/*******************************************************************/*
CHECK_VOLUME_ACCESS EQU *
CLEAR RACF_PROFILE
MVC RACF_TYPE(L'RACF_PROF_TYPE),RACF_PROF_TYPE
TM FLAG,FLAG_OVERFLOW
BO CHECK_OVERFLOW_VOLUME
TM FLAG,FLAG_DEFAULT
BO CHECK_DEFAULT_VOLUME
*/*******************************************************************/*
*/* SEARCH RACF PROFILE TO VALIDATE THE ACCESS TO SPOOL VOLUME */*
*/*******************************************************************/*
MVC RACF_SPOOLV(L'RACF_PROF_SPOOLV),RACF_PROF_SPOOLV
MVC RACF_SPOOLV_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLV_DOT,C'.'
MVC RACF_SPOOLV_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* SEARCH RACF PROFILE TO VALIDATE THE ACCESS TO DEFAULT VOLUME */*
*/*******************************************************************/*
CHECK_OVERFLOW_VOLUME EQU *
MVC RACF_SPOOLO(L'RACF_PROF_SPOOLO),RACF_PROF_SPOOLO
MVC RACF_SPOOLO_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLO_DOT,C'.'
MVC RACF_SPOOLO_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* SEARCH RACF PROFILE TO VALIDATE THE ACCESS TO DEFAULT VOLUME */*
*/*******************************************************************/*
CHECK_DEFAULT_VOLUME EQU *
MVC RACF_SPOOLD(L'RACF_PROF_SPOOLD),RACF_PROF_SPOOLD
MVC RACF_SPOOLD_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLD_DOT,C'.'
MVC RACF_SPOOLD_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* ROUTINE TO GET SYSID FROM SYSTEM */*
*/*******************************************************************/*
GET_SYSID EQU *
L R1,CVTPTR
L R1,CVTSMCA-CVTMAP(R1)
USING SMCABASE,R1
MVC SYSID,SMCASID
BR 10
*/*******************************************************************/*
*/* VERIFY IF EXISTS USER PARAMETER ON JOB CARD OR GET A USER */*
*/*******************************************************************/*
GET_USERID EQU *
CLEAR JOB_USERID
CLI JCTNOUSR,X'00'
BNE USERID_FOUND
GETMSG 5,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG5_JOBNAME-MSG5(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* GET THE USERID FROM JCT SUBMITTING USER */*
*/*******************************************************************/*
USERID_FOUND EQU *
OI FLAG,FLAG_USERID
MVC JOB_USERID(8),JCTNOUSR
TM JCTFLAG1,JCT1UNDF
BOR R10
CLC JCTJUSID,=8X'00'
BER R10
CLC JCTJUSID,JCTNOUSR
BER R10
MVC JOB_USERID(8),JCTJUSID
BR R10
*/*******************************************************************/*
*/* SUBROUTINE TO REQUEST RACF ACCESS VALIDATION */*
*/*******************************************************************/*
RACF_CHECK_AUTH EQU *
STM R3,R4,SAVE34
MVC RACFT(RACLEN),RAC_LIST
LA R3,RACF_PROFILE
LA R4,RACF_CLASS_FACILITY
RACROUTE REQUEST=AUTH, X
WORKA=RACWORK, X
ENTITY=((3)), X
CLASS=((4)), X
ATTR=READ, X
GENERIC=ASIS, X
USERID=JOB_USERID, X
RELEASE=7790, X
LOG=NONE, X
MF=(E,RACFT)
LM R3,R4,SAVE34
BR 10
*/*******************************************************************/*
*/* SUBROUTINE TO SEND A MESSAGE TO CONSOLE */*
*/*******************************************************************/*
SEND_WTO EQU *
MVC WTO_MSGL,=AL2(L'WTO_MESSAGE)
MVC WTO_EXEC,WTO_LIST
$$WTO WTO_EXEC,TEXT=WTO_MSG
BR R10
*/*******************************************************************/*
*/* END OF EXIT - RELEASE ACQUIRED STORAGE AND RETURN TO CALLER */*
*/*******************************************************************/*
END_EXIT_08 EQU *
MVC RETURN_CODE,FULL_8
END_OF_EXIT EQU *
L R15,RETURN_CODE
LR R1,R13
L R13,4(R13)
ST R15,16(R13)
STORAGE RELEASE,LENGTH=WORKLEN,ADDR=(1)
LM R14,R12,12(R13)
BR R14
*/*******************************************************************/*
*/* INSTRUCTION AREA USED TO EXECUTE */*
*/*******************************************************************/*
TEST_BITMASK TM 0(R1),X'00'
*/*******************************************************************/*
*/* WORKAREA OBTAINED BY EXIT */*
*/*******************************************************************/*
WORKAREA DSECT
SAVEAREA DS 18F
SAVE34 DS 2F
DOUBLE DS D
RETURN_CODE DS F
BITMASK DS X
#SPOOL_VOLUMES DS H
#FENCE_VOLUMES DS X
JOB_NUMBER DS F
JOB_NAME DS CL8
JOB_USERID DS CL8
JOB_CLASS DS CL1
JOB_JOBID DS CL8
SYSID DS CL4
DAS_ADDRESS DS F
DAS_FIRST DS F
SPOOL_MASK_ADDRESS DS F
SPOOL_AVAIL_ADDRESS DS F
SPOOL_ALLOCATED_MASK DS 8F
SPOOL_AVAILABLE_MASK DS 8F
SPOOL_ALLOWED_MASK DS 8F
SPOOL_VOLUME DS CL6
SPOOL_VOL_SET DS X
SPOOL_VOL_TYPE DS CL7
FLAG DS X
FLAG_CLASS EQU X'01'
FLAG_SPOOL EQU X'02'
FLAG_USERID EQU X'04'
FLAG_JOBNAME EQU X'08'
FLAG_CANCEL EQU X'10'
FLAG_OVERFLOW EQU X'20'
FLAG_DEFAULT EQU X'40'
*/*******************************************************************/*
*/* DEFINE AREA TO MAP RACF PROFILES TO BE USED */*
*/*******************************************************************/*
RACF_JOB_TYPE DS CL3
RACF_PROFILE DS CL44
ORG RACF_PROFILE
RACF_TYPE DS CL(L'RACF_PROF_TYPE)
RACF_TYPE_VAR DS 0C
ORG RACF_TYPE_VAR
RACF_SPOOLJ DS CL(L'RACF_JOB_TYPE)
RACF_SPOOLJ_DOT1 DS CL1
RACF_SPOOLJ_SYSID DS CL4
RACF_SPOOLJ_DOT2 DS CL1
RACF_SPOOLJ_JOB DS CL8
ORG RACF_TYPE_VAR
RACF_SPOOLV DS CL(L'RACF_PROF_SPOOLV)
RACF_SPOOLV_SYSID DS CL4
RACF_SPOOLV_DOT DS CL1
RACF_SPOOLV_VOLUME DS CL6
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLO DS CL(L'RACF_PROF_SPOOLO)
RACF_SPOOLO_SYSID DS CL4
RACF_SPOOLO_DOT DS CL1
RACF_SPOOLO_VOLUME DS CL6
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLD DS CL(L'RACF_PROF_SPOOLD)
RACF_SPOOLD_SYSID DS CL4
RACF_SPOOLD_DOT DS CL1
RACF_SPOOLD_VOLUME DS CL6
ORG
*/*******************************************************************/*
*/* DEFINE CLASS TO USE WITH RACF AND LIST FORM OF MACRO RACROUTE */*
*/*******************************************************************/*
DS 0F
RACWORK DS CL512 WORK AREA DO RACF
DS 0F
RACFT RACROUTE REQUEST=AUTH, X
WORKA=*-*, X
CLASS='FACILITY', X
ATTR=READ, X
RELEASE=7790, X
MF=L
*/*******************************************************************/*
*/* DEFINE WORK AREA TO BE USED BY WTO MACRO */*
*/*******************************************************************/*
WTO_EXEC DS CL(WTO_LEN)
WTO_MSG DS 0H
WTO_MSGL DS AL2
WTO_MESSAGE DS CL100
*/*******************************************************************/*
*/* DEFINE AREA USED BY PERFORM PROCESS */*
*/*******************************************************************/*
PERFORM GENERATE
WORKLEN EQU *-WORKAREA
EJECT
*/*******************************************************************/*
*/* USED CONSTANTS BY EXIT */*
*/*******************************************************************/*
EXIT011 CSECT
EXIT011 AMODE 31
EXIT011 RMODE ANY
BINZEROS DC 2F'0'
FULL_0 DC F'0'
FULL_4 DC F'4'
FULL_8 DC F'8'
FULL_MASK DC 32X'FF'
DAS_POOL_ID DC CL13'**DAS POOL**'
VOL_DEFAULT DC C'DEFAULT'
VOL_ALLOWED DC C'ALLOWED'
VOL_OVERFLOW DC C'OVRFLOW'
*/*******************************************************************/*
*/* DEFINE CONSTANTS TO BE USED FOR RACF PROCESSING */*
*/*******************************************************************/*
RACF_CLASS_FACILITY DC AL1(L'FACILITY)
FACILITY DC C'FACILITY'
RACF_PROF_TYPE DC C'$JES2.SPART.'
RACF_PROF_JOB DC C'JOB'
RACF_PROF_TSU DC C'TSU'
RACF_PROF_STC DC C'STC'
RACF_PROF_SPOOLV DC C'VOL.'
RACF_PROF_SPOOLO DC C'OVRFL.'
RACF_PROF_SPOOLD DC C'DFLT.'
DS 0F
RAC_LIST RACROUTE REQUEST=AUTH, X
WORKA=*-*, X
CLASS='FACILITY', X
ATTR=READ, X
RELEASE=7790, X
MF=L
RACLEN EQU (*-RAC_LIST)
*/*******************************************************************/*
*/* DEFINE LIST FORM TO $$WTO MACRO */*
*/*******************************************************************/*
WTO_LIST WTO TEXT=*-*,MF=L
WTO_LEN EQU *-WTO_LIST
*/*******************************************************************/*
*/* DEFINE TEXT MESSAGES USED BY EXIT */*
*/*******************************************************************/*
MESSAGES DS 0F
MSG1 DC CL100' '
ORG MSG1
DC C'$EXT1101I '
MSG1_JOBTYPE DC CL3' '
DC C' '
MSG1_JOBNAME DC CL8' '
DC C' SELECTED TO USE SPOOL PARTITION ON SYSID '
MSG1_SYSID DC CL4' '
ORG
MSG2 DC CL100'$EXT1102E $DAS COULD NOT BE FOUND ON JES2 AREA'
MSG3 DC CL100' '
ORG MSG3
DC C'$EXT1103I VOLUME '
MSG3_VOLUME DC CL6' '
DC C' ADDED TO '
MSG3_JOBTYPE DC CL3' '
DC C' '
MSG3_JOBNAME DC CL8' '
DC C' AS '
MSG3_VOLTYPE DC CL7' '
DC C' SPOOL VOLUME'
ORG
MSG4 DC CL100' '
ORG MSG4
DC C'$EXT1104W NO SPOOL VOLUMES SELECTED TO JOB '
MSG4_JOBNAME DC CL8' '
ORG
MSG5 DC CL100' '
ORG MSG5
DC C'$EXT1105E USERID NOT FOUND FOR JOB '
MSG5_JOBNAME DC CL8' '
ORG
MSG6 DC CL100' '
ORG MSG6
DC C'$EXT1106I FENCING IS NOT ACTIVE TO SYSTEM '
MSG6_SYSID DC CL4' '
ORG
MSG7 DC CL100' '
ORG MSG7
DC C'$EXT1107E ERROR ON ACCESS JCT EXTENSION FOR JOB '
MSG7_JOBNAME DC CL8' '
ORG
*/*******************************************************************/*
*/* DEFINE Z/OS MAPPING MACROS */*
*/*******************************************************************/*
EJECT
LTORG
IEESMCA
$MODEND
END
E.3 Exit 12 program source code
The JES2 Exit 12 sample code that is used to implement the spool partitioning function to JES2 that is based on RACF profiles is shown in Example E-4.
Example E-4 JES2 Exit 12 sample
TITLE 'JES2 EXIT012 - SPOOL PARTITIONING'
*/*******************************************************************/*
*/* PROGRAM - JES2X012 */*
*/* */*
*/* FUNCTION - THIS EXIT WAS CODED TO WORK AS COMPLEMENT OF EXIT 11 */*
*/* TO ADD MORE SPOOL SPACE TO A JOB */*
*/*******************************************************************/*
EJECT
PRINT GEN
*/*******************************************************************/*
*/* COPY OF $HASPGBL MACRO */*
*/*******************************************************************/*
COPY $HASPGBL
EJECT
*/*******************************************************************/*
*/* JES2 MACROS EXPANSION */*
*/*******************************************************************/*
JES2X012 $MODULE ENVIRON=USER, X
RMODE=ANY, X
IBMJES2=SAMPLE, X
$BUFFER, REQ BY $REQBUF, $FREEBUF X
$CAT, REQ BY HCT X
$CNVWORK, CONV. PROCESSOR PCE WORK1 AREA X
$DAS, IOT MAPPINT MACRO X
$DTE, REQ BY PCE X
$DTECNV, REQ BY DTE X
$ERA, REQ BY DTE X
$HASPEQU, HASP EQUATES X
$HCCT, REQ BY $SAVE, $RETURN, ETC X
$HCT, REQ BY $SAVE, $RETURN, ETC X
$IOT, IOT MAPPINT MACRO X
$JCT, REQ BY CAT X
$JCTX, REQ BY CAT X
$JQE, REQ BY HCT X
$MIT, REQ BY MODEND X
$PADDR, REQ BY HCT X
$PCE, REQ BY HCT X
$SCAT, REQ BY HCT X
$TAB, REQ BY $CNVWORK X
$TQE, REQ BY $CNVWORK X
$XECB, REQ BY DTE X
$XIT, X
CVT, COMMUNICATION VECTOR TABLE X
DEB, DATA EXTEND BLOCK X
CNMB, CONVERTER MESSAGE BUFFER X
RPL, ACB REQUEST PARAMETER LIST X
SDWA, SYSTEM DIAGNOSIS WORK1ING AREA X
WPL REQ BY $$WTO
*/*******************************************************************/*
*/* JES2 EXIT 11 ENTRY POINT */*
*/*******************************************************************/*
EXIT012 $ENTRY BASE=R12,CSECT=YES
SAVE (14,12)
LR R12,R15
LM R7,R9,0(R1)
USING IOT,R7
USING JCT,R8
USING HCCT,R11
L R2,CCTHCT
USING HCT,R2
*/*******************************************************************/*
*/* OBTAIN STORAGE TO VARIABLES USED BY EXIT */*
*/*******************************************************************/*
STORAGE_OBTAIN EQU *
STORAGE OBTAIN,LENGTH=WORKLEN,LOC=31
ST R13,4(R1)
ST R1,8(R13)
LR R13,R1
USING WORKAREA,R13
*/*******************************************************************/*
*/* VERIFY MAIN CONDITIONS TO PROCESS THE EXIT */*
*/*******************************************************************/*
TEST_EXIT_CALL EQU *
XC RETURN_CODE,RETURN_CODE
LTR R8,R8
BZ END_OF_EXIT
TM JCTUSERB,X'B0'
BNO END_OF_EXIT
TM JCTJOBFL,JCTBATCH
BO JOB_BATCH
TM JCTJOBFL,JCTTSUJB
BO JOB_TSU
TM JCTJOBFL,JCTSTCJB
BO JOB_STC
B END_OF_EXIT
*/*******************************************************************/*
*/* MOVE THE CORRESPONDING JOB TYPE VALUE TO RACF PROFILE */*
*/*******************************************************************/*
JOB_BATCH EQU *
MVC RACF_JOB_TYPE,RACF_PROF_JOB
B PROCESS_EXIT
JOB_TSU EQU *
MVC RACF_JOB_TYPE,RACF_PROF_TSU
B PROCESS_EXIT
JOB_STC EQU *
MVC RACF_JOB_TYPE,RACF_PROF_STC
*/*******************************************************************/*
*/* GET REQUIRED INFORMATION FROM JCT, IOT AND HCT */*
*/*******************************************************************/*
PROCESS_EXIT EQU *
MVC #SPOOL_VOLUMES,$SPOLNUM
MVC #FENCE_VOLUMES,$FNCCNT
MVC JOB_NAME,JCTJNAME
MVC JOB_NUMBER,JCTJBNUM
MVC JOB_JOBID,JCTJOBID
MVC JOB_CLASS,JCTJCLAS
PERFORM GET_SYSID,R
PERFORM GET_USERID,R
MVC SPOOL_ALLOCATED_MASK,IOTSPMSK
MVC SPOOL_AVAILABLE_MASK,CCTVBLOB
MVC SPOOL_ALLOWED_MASK,0(R9)
NC SPOOL_ALLOWED_MASK,CCTSPLAF
$CNTBIT FIELD=SPOOL_ALLOWED_MASK
L R2,CCTHCT
STC R1,#SPOOL_USED
*/*******************************************************************/*
*/* VERIFY IF THE FENCE PARAMETER TO SPOOL ALLOCATION IS ACTIVE */*
*/*******************************************************************/*
TM CCTSTUS,CCTSMVFN
BO VALIDATE_EXTENSION
GETMSG 7,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG7_SYSID-MSG7(L'SYSID),SYSID
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* SEND MESSAGE TO INFORM THE JOB REQUESTING ADDITIONAL SPACE */*
*/*******************************************************************/*
VALIDATE_EXTENSION EQU *
GETMSG 1,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG1_JOBNAME-MSG1(L'JOB_NAME),JOB_NAME
MVC WTO_MESSAGE+MSG1_JOBTYPE-MSG1(L'RACF_JOB_TYPE),RACF_JOB_TYPE
PERFORM SEND_WTO,R
MVC SPOOL_VOL_TYPE,VOL_ALLOWED
*/*******************************************************************/*
*/* START THE $DAS SEARCHING TO FIND ADDITIONAL VOLUMES */*
*/*******************************************************************/*
START_DAS_SEARCH EQU *
L R3,CCTDAS1
USING DAS,R3
XC SPOOL_VOL_SET,SPOOL_VOL_SET
LA R1,SPOOL_ALLOWED_MASK
ST R1,SPOOL_MASK_ADDRESS
LA R1,SPOOL_AVAILABLE_MASK
ST R1,SPOOL_AVAIL_ADDRESS
LH R4,#SPOOL_VOLUMES
XC BITMASK,BITMASK
OI BITMASK,X'80'
*/*******************************************************************/*
*/* VALIDATE IF THE JOB IS USING THE MAXIMUM OF VOLUMES ALLOWED */*
*/*******************************************************************/*
NEW_DAS_ENTRY EQU *
CLC SPOOL_VOL_SET,#FENCE_VOLUMES
BNL END_DAS_CHAIN
TM DASFLAG,DASACTIV
BNO NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* VERIFY IF THE CURRENT VOLUME IS ALREADY IN USE BY JOB */*
*/*******************************************************************/*
L R1,SPOOL_MASK_ADDRESS
XR R15,R15
IC R15,BITMASK
EX R15,TEST_BITMASK
BO NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* VERIFY IF THE CURRENT VOLUME HAVE SPACE TO BE USED BY JOB */*
*/*******************************************************************/*
L R1,SPOOL_AVAIL_ADDRESS
XR R15,R15
IC R15,BITMASK
EX R15,TEST_BITMASK
BNO NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* VERIFY IF THE CURRENT VOLUME CAN BE USED BY JOB */*
*/*******************************************************************/*
MVC SPOOL_VOLUME,DASVOLID
PERFORM CHECK_VOLUME_ACCESS,R
PERFORM RACF_CHECK_AUTH,R
LTR R15,R15
BNZ NEXT_DAS_ENTRY
*/*******************************************************************/*
*/* ADD THE SPOOL VOLUME AS A VOLUME ALLOWED TO BE ALLOCATED */*
*/*******************************************************************/*
ADD_SPOOL_VOLUME EQU *
XR R1,R1
IC R1,SPOOL_VOL_SET
LA R1,1(R1)
STC R1,SPOOL_VOL_SET
OI FLAG,FLAG_SPOOL
*/*******************************************************************/*
*/* SET A NEW BIT ON ALLOWED BITMASK FOR THE JOB */*
*/*******************************************************************/*
L R1,SPOOL_MASK_ADDRESS
OC 0(L'BITMASK,R1),BITMASK
*/*******************************************************************/*
*/* SEND MESSAGE TO CONSOLE WITH SPOOL VOLUME ADDED TO JOB */*
*/*******************************************************************/*
GETMSG 3,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG3_VOLUME-MSG3(L'SPOOL_VOLUME),SPOOL_VOLUME
MVC WTO_MESSAGE+MSG3_JOBNAME-MSG3(L'JOB_NAME),JOB_NAME
MVC WTO_MESSAGE+MSG3_JOBTYPE-MSG3(L'RACF_JOB_TYPE),RACF_JOB_TYPE
MVC WTO_MESSAGE+MSG3_VOLTYPE-MSG3(L'SPOOL_VOL_TYPE),SPOOL_VOL_TYPE
PERFORM SEND_WTO,R
*/*******************************************************************/*
*/* JUMP TO NEXT AVAILABLE DAS ENTRY ON DAS CHAIN */*
*/*******************************************************************/*
NEXT_DAS_ENTRY EQU *
XR R1,R1
ICM R1,15,DASTRAKQ
LTR R1,R1
BZ END_DAS_CHAIN
LA R3,DASSIZC(R3)
PERFORM NEXT_BITMASK,R
BCT R4,NEW_DAS_ENTRY
*/*******************************************************************/*
*/* CHECK IF WAS SET ANY VOLUME TO BE USED BY JOB */*
*/*******************************************************************/*
END_DAS_CHAIN EQU *
TM FLAG,FLAG_SPOOL
BNO VALIDATE_OVERFLOW
MVC 0(L'SPOOL_ALLOWED_MASK,R9),SPOOL_ALLOWED_MASK
B END_EXIT_08
*/*******************************************************************/*
*/* VALIDATE IF THE JOB IS CANDIDATE TO OVERFLOW THE SPOOL */*
*/*******************************************************************/*
VALIDATE_OVERFLOW EQU *
CLEAR RACF_PROFILE
MVC RACF_TYPE(L'RACF_PROF_TYPE),RACF_PROF_TYPE
MVC RACF_SPOOLE(L'RACF_PROF_SPOOLE),RACF_PROF_SPOOLE
MVC RACF_SPOOLE_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLE_DOT,C'.'
MVC RACF_SPOOLE_JOBNAME(L'JOB_NAME),JOB_NAME
PERFORM RACF_CHECK_AUTH,R
LTR R15,R15
BNZ PROCESS_OPERATOR_REQUEST
*/*******************************************************************/*
*/* SET FLAG TO SEARCH THE DAS CHAIN FOR OVERFLOW VOLUMES AVAILABLE */*
*/*******************************************************************/*
GET_OVERFLOW_VOLUMES EQU *
TM FLAG,FLAG_OVERFLOW
BO GET_DEFAULT_VOLUMES
OI FLAG,FLAG_OVERFLOW
MVC SPOOL_VOL_TYPE,VOL_OVERFLOW
B START_NEW_DAS_SEARCH
*/*******************************************************************/*
*/* SET FLAG TO SEARCH THE DAS CHAIN FOR OVERFLOW VOLUMES AVAILABLE */*
*/*******************************************************************/*
GET_DEFAULT_VOLUMES EQU *
TM FLAG,FLAG_DEFAULT
BO PROCESS_OPERATOR_REQUEST
OI FLAG,FLAG_DEFAULT
MVC SPOOL_VOL_TYPE,VOL_DEFAULT
B START_NEW_DAS_SEARCH
*/*******************************************************************/*
*/* SEND A MESSAGE INDICATING THE START OF A NEW SEARCH ON $DAS */*
*/*******************************************************************/*
START_NEW_DAS_SEARCH EQU *
GETMSG 9,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG9_JOBTYPE-MSG9(L'RACF_JOB_TYPE),RACF_JOB_TYPE
MVC WTO_MESSAGE+MSG9_JOBNAME-MSG9(L'JOB_NAME),JOB_NAME
MVC WTO_MESSAGE+MSG9_VOLTYPE-MSG9(L'SPOOL_VOL_TYPE),SPOOL_VOL_TYPE
PERFORM SEND_WTO,R
B START_DAS_SEARCH
*/*******************************************************************/*
*/* DISPLAY MESSAGES WITH NO MORE VOLUMES AVAILABLE */*
*/*******************************************************************/*
PROCESS_OPERATOR_REQUEST EQU *
GETMSG 4,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG4_JOBNAME-MSG4(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTO,R
*/*******************************************************************/*
*/* PROCESS WTOR REQUEST AND WAIT FOR OPERATOR DECISION */*
*/*******************************************************************/*
PROCESS_WTOR EQU *
GETMSG 8,WTOR_MESSAGE,MESSAGES
MVC WTOR_MESSAGE+MSG8_JOBTYPE-MSG8(L'RACF_JOB_TYPE),RACF_JOB_TYPE
MVC WTOR_MESSAGE+MSG8_JOBNAME-MSG8(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTOR,R
*/*******************************************************************/*
*/* PROCESS THE ANSWER FROM OPERATOR CONSOLE */*
*/*******************************************************************/*
CLI WTOR_RESP,C'C'
BE SET_ALL_VOLUMES
CLI WTOR_RESP,C'R'
BNE PROCESS_WTOR
NI FLAG,255-(FLAG_OVERFLOW+FLAG_SPOOL+FLAG_DEFAULT)
B START_DAS_SEARCH
*/*******************************************************************/*
*/* SEARCH RACF TO FIND A VOLUME WITH ACCESS TO BE USED */*
*/*******************************************************************/*
CHECK_VOLUME_ACCESS EQU *
CLEAR RACF_PROFILE
MVC RACF_TYPE(L'RACF_PROF_TYPE),RACF_PROF_TYPE
TM FLAG,FLAG_OVERFLOW
BO CHECK_OVERFLOW_PROFILE
TM FLAG,FLAG_DEFAULT
BO CHECK_DEFAULT_PROFILE
*/*******************************************************************/*
*/* CHECK IF THE VOLUME CAN BE USED BY JOB */*
*/*******************************************************************/*
MVC RACF_SPOOLV(L'RACF_PROF_SPOOLV),RACF_PROF_SPOOLV
MVC RACF_SPOOLV_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLV_DOT,C'.'
MVC RACF_SPOOLV_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* VALIDATE THE OVERFLOW PROFILE TO A VOLUME */*
*/*******************************************************************/*
CHECK_OVERFLOW_PROFILE EQU *
MVC RACF_SPOOLO(L'RACF_PROF_SPOOLO),RACF_PROF_SPOOLO
MVC RACF_SPOOLO_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLO_DOT,C'.'
MVC RACF_SPOOLO_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* VALIDATE THE DEFAULT PROFILE FOR A AVAILABLE VOLUME */*
*/*******************************************************************/*
CHECK_DEFAULT_PROFILE EQU *
MVC RACF_SPOOLD(L'RACF_PROF_SPOOLD),RACF_PROF_SPOOLD
MVC RACF_SPOOLD_SYSID(L'SYSID),SYSID
MVI RACF_SPOOLD_DOT,C'.'
MVC RACF_SPOOLD_VOLUME(L'SPOOL_VOLUME),SPOOL_VOLUME
BR R10
*/*******************************************************************/*
*/* SET ALL MASK BITS TO USE OVERFLOW VOLUMES */*
*/*******************************************************************/*
SET_ALL_VOLUMES EQU *
MVC 0(L'SPOOL_ALLOWED_MASK,R9),FULL_MASK
GETMSG 5,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG5_JOBNAME-MSG5(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTO,R
B END_EXIT_08
*/*******************************************************************/*
*/* POINT TO NEXT BITMAKS TO BE USED FOR SPOOL VOLUME */*
*/*******************************************************************/*
NEXT_BITMASK EQU *
TM BITMASK,X'01'
BO SHIFT_SPOOL_MASK
XR R1,R1
IC R1,BITMASK
SRL R1,1
STC R1,BITMASK
BR R10
*/*******************************************************************/*
*/* WALK THRU SPOOL_ALLOWED_MASK TO NEXT 32 BITS */*
*/*******************************************************************/*
SHIFT_SPOOL_MASK EQU *
L R1,SPOOL_MASK_ADDRESS
LA R1,L'BITMASK(R1)
ST R1,SPOOL_MASK_ADDRESS
L R1,SPOOL_AVAIL_ADDRESS
LA R1,L'BITMASK(R1)
ST R1,SPOOL_AVAIL_ADDRESS
XC BITMASK,BITMASK
OI BITMASK,X'80'
BR R10
*/*******************************************************************/*
*/* ROUTINE TO GET SYSID FROM SYSTEM */*
*/*******************************************************************/*
GET_SYSID EQU *
L R1,CVTPTR
L R1,CVTSMCA-CVTMAP(R1)
USING SMCABASE,R1
MVC SYSID,SMCASID
BR 10
*/*******************************************************************/*
*/* VERIFY IF EXISTS USER PARAMETER ON JOB CARD OR GET A USER */*
*/*******************************************************************/*
GET_USERID EQU *
CLEAR JOB_USERID
CLI JCTNOUSR,X'00'
BNE USERID_FOUND
GETMSG 6,WTO_MESSAGE,MESSAGES
MVC WTO_MESSAGE+MSG6_JOBNAME-MSG6(L'JOB_NAME),JOB_NAME
PERFORM SEND_WTO,R
B END_OF_EXIT
*/*******************************************************************/*
*/* GET THE USERID FROM JCT SUBMITTING USER */*
*/*******************************************************************/*
USERID_FOUND EQU *
OI FLAG,FLAG_USERID
MVC JOB_USERID(8),JCTNOUSR
TM JCTFLAG1,JCT1UNDF
BOR R10
CLC JCTJUSID,=8X'00'
BER R10
CLC JCTJUSID,JCTNOUSR
BER R10
MVC JOB_USERID(8),JCTJUSID
BR R10
*/*******************************************************************/*
*/* SUBROUTINE TO REQUEST RACF ACCESS VALIDATION */*
*/*******************************************************************/*
RACF_CHECK_AUTH EQU *
STM R3,R4,SAVE34
MVC RACFT(RACLEN),RAC_LIST
LA R3,RACF_PROFILE
LA R4,RACF_CLASS_FACILITY
RACROUTE REQUEST=AUTH, X
WORKA=RACWORK, X
ENTITY=((3)), X
CLASS=((4)), X
ATTR=READ, X
GENERIC=ASIS, X
USERID=JOB_USERID, X
RELEASE=7790, X
LOG=NONE, X
MF=(E,RACFT)
LM R3,R4,SAVE34
BR 10
*/*******************************************************************/*
*/* SUBROUTINE TO SEND A MESSAGE TO CONSOLE */*
*/*******************************************************************/*
SEND_WTO EQU *
MVC WTO_MSGL,=AL2(L'WTO_MESSAGE)
MVC WTO_EXEC,WTO_LIST
$$WTO WTO_EXEC,TEXT=WTO_MSG
BR R10
*/*******************************************************************/*
*/* SUBROUTINE TO SEND A WTOR REQUEST TO CONSOLE */*
*/*******************************************************************/*
SEND_WTOR EQU *
XC WTOR_ECB,WTOR_ECB
MVC WTOR_MSGL,=AL2(L'WTOR_MESSAGE)
MVC WTOR_EXEC,WTOR_LIST
WTOR TEXT=(WTOR_MSG,WTOR_RESP,WTOR_RLEN,WTOR_ECB), X
MF=(E,WTOR_EXEC,EXTENDED)
WAIT ECB=WTOR_ECB
BR R10
*/*******************************************************************/*
*/* END OF EXIT - RELEASE ACQUIRED STORAGE AND RETURN TO CALLER */*
*/*******************************************************************/*
END_EXIT_08 EQU *
MVC RETURN_CODE,FULL_8
END_OF_EXIT EQU *
L R15,RETURN_CODE
LR R1,R13
L R13,4(R13)
ST R15,16(R13)
STORAGE RELEASE,LENGTH=WORKLEN,ADDR=(1)
LM R14,R12,12(R13)
BR R14
*/*******************************************************************/*
*/* INSTRUCTION AREA USED TO EXECUTE */*
*/*******************************************************************/*
TEST_BITMASK TM 0(R1),X'00'
*/*******************************************************************/*
*/* WORKAREA OBTAINED BY EXIT */*
*/*******************************************************************/*
WORKAREA DSECT
SAVEAREA DS 18F
SAVE34 DS 2F
DOUBLE DS D
RETURN_CODE DS F
BITMASK DS X
#SPOOL_VOLUMES DS H
#SPOOL_USED DS F
#FENCE_VOLUMES DS X
JOB_NUMBER DS F
JOB_NAME DS CL8
JOB_USERID DS CL8
JOB_CLASS DS CL1
JOB_JOBID DS CL8
SYSID DS CL4
SPOOL_MASK_ADDRESS DS F
SPOOL_AVAIL_ADDRESS DS F
SPOOL_ALLOCATED_MASK DS 8F
SPOOL_AVAILABLE_MASK DS 8F
SPOOL_ALLOWED_MASK DS 8F
SPOOL_VOLUME DS CL6
SPOOL_VOL_SET DS X
SPOOL_VOL_TYPE DS CL7
FLAG DS X
FLAG_CLASS EQU X'01'
FLAG_SPOOL EQU X'02'
FLAG_USERID EQU X'04'
FLAG_JOBNAME EQU X'08'
FLAG_CANCEL EQU X'10'
FLAG_OVERFLOW EQU X'20'
FLAG_DEFAULT EQU X'40'
*/*******************************************************************/*
*/* DEFINE AREA TO MAP RACF PROFILES TO BE USED */*
*/*******************************************************************/*
RACF_JOB_TYPE DS CL3
RACF_PROFILE DS CL44
ORG RACF_PROFILE
RACF_TYPE DS CL(L'RACF_PROF_TYPE)
RACF_TYPE_VAR DS 0C
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLC DS CL(L'RACF_PROF_SPOOLC)
RACF_SPOOLC_SYSID DS CL4
RACF_SPOOLC_DOT DS CL1
RACF_SPOOLC_CLASS DS CL1
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLV DS CL(L'RACF_PROF_SPOOLV)
RACF_SPOOLV_SYSID DS CL4
RACF_SPOOLV_DOT DS CL1
RACF_SPOOLV_VOLUME DS CL6
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLD DS CL(L'RACF_PROF_SPOOLD)
RACF_SPOOLD_SYSID DS CL4
RACF_SPOOLD_DOT DS CL1
RACF_SPOOLD_VOLUME DS CL6
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLO DS CL(L'RACF_PROF_SPOOLO)
RACF_SPOOLO_SYSID DS CL4
RACF_SPOOLO_DOT DS CL1
RACF_SPOOLO_VOLUME DS CL6
ORG
ORG RACF_TYPE_VAR
RACF_SPOOLE DS CL(L'RACF_PROF_SPOOLE)
RACF_SPOOLE_SYSID DS CL4
RACF_SPOOLE_DOT DS CL1
RACF_SPOOLE_JOBNAME DS CL8
ORG
*/*******************************************************************/*
*/* DEFINE CLASS TO USE WITH RACF AND LIST FORM OF MACRO RACROUTE */*
*/*******************************************************************/*
DS 0F
RACWORK DS CL512 WORK AREA DO RACF
DS 0F
RACFT RACROUTE REQUEST=AUTH, X
WORKA=*-*, X
CLASS='FACILITY', X
ATTR=READ, X
RELEASE=7790, X
MF=L
*/*******************************************************************/*
*/* DEFINE WORK AREA TO BE USED BY WTO MACRO */*
*/*******************************************************************/*
WTO_EXEC DS CL(WTO_LEN)
WTO_MSG DS 0H
WTO_MSGL DS AL2
WTO_MESSAGE DS CL100
*/*******************************************************************/*
*/* DEFINE WORK AREA TO BE USED BY WTO MACRO */*
*/*******************************************************************/*
WTOR_ECB DS F
WTOR_RLEN EQU L'WTOR_RESP
WTOR_RESP DS CL1
WTOR_EXEC DS CL(WTOR_LEN)
WTOR_MSG DS 0H
WTOR_MSGL DS AL2
WTOR_MESSAGE DS CL100
*/*******************************************************************/*
*/* DEFINE AREA USED BY PERFORM PROCESS */*
*/*******************************************************************/*
PERFORM GENERATE
WORKLEN EQU *-WORKAREA
EJECT
*/*******************************************************************/*
*/* USED CONSTANTS BY EXIT */*
*/*******************************************************************/*
EXIT012 CSECT
EXIT012 AMODE 31
EXIT012 RMODE ANY
FULL_0 DC F'0'
FULL_4 DC F'4'
FULL_8 DC F'8'
FULL_32 DC F'32'
FULL_MASK DC 32X'FF'
VOL_ALLOWED DC C'ALLOWED'
VOL_DEFAULT DC C'DEFAULT'
VOL_OVERFLOW DC C'OVRFLOW'
*/*******************************************************************/*
*/* DEFINE CONSTANTS TO BE USED FOR RACF PROCESSING */*
*/*******************************************************************/*
RACF_CLASS_FACILITY DC AL1(L'FACILITY)
FACILITY DC C'FACILITY'
RACF_PROF_TYPE DC C'$JES2.SPART.'
RACF_PROF_JOB DC C'JOB'
RACF_PROF_TSU DC C'TSU'
RACF_PROF_STC DC C'STC'
RACF_PROF_SPOOLC DC C'CLS.'
RACF_PROF_SPOOLV DC C'VOL.'
RACF_PROF_SPOOLO DC C'OVRFL.'
RACF_PROF_SPOOLD DC C'DFLT.'
RACF_PROF_SPOOLE DC C'EXT.'
DS 0F
RAC_LIST RACROUTE REQUEST=AUTH, X
WORKA=*-*, X
CLASS='FACILITY', X
ATTR=READ, X
RELEASE=7790, X
MF=L
RACLEN EQU (*-RAC_LIST)
*/*******************************************************************/*
*/* DEFINE LIST FORM TO $$WTO MACRO */*
*/*******************************************************************/*
WTO_LIST WTO TEXT=*-*,MF=L
WTO_LEN EQU *-WTO_LIST
*/*******************************************************************/*
*/* DEFINE LIST FORM TO WTOR MACRO */*
*/*******************************************************************/*
WTOR_LIST WTOR TEXT=(WTOR_MSG,*-*,WTOR_RLEN,*-*),MF=L
WTOR_LEN EQU *-WTOR_LIST
*/*******************************************************************/*
*/* DEFINE TEXT MESSAGES USED BY EXIT */*
*/*******************************************************************/*
MESSAGES DS 0F
MSG1 DC CL100' '
ORG MSG1
DC C'$EXT1201I '
MSG1_JOBTYPE DC CL3' '
DC C' '
MSG1_JOBNAME DC CL8' '
DC C' REQUESTED TO USE ADDITIONAL SPOOL VOLUME'
ORG
MSG2 DC CL100'$EXT1202E $DAS COULD NOT BE FOUND ON JES2 AREA'
MSG3 DC CL100' '
ORG MSG3
DC C'$EXT1203I VOLUME '
MSG3_VOLUME DC CL6' '
DC C' ADDED TO '
MSG3_JOBTYPE DC CL3' '
DC C' '
MSG3_JOBNAME DC CL8' '
DC C' AS '
MSG3_VOLTYPE DC CL7' '
DC C' SPOOL VOLUME'
ORG
MSG4 DC CL100' '
ORG MSG4
DC C'$EXT1204W SPOOL PARTITIONING FOR JOB '
MSG4_JOBNAME DC CL8' '
DC C' IS FULL. NO OVERFLOW IS POSSIBLE'
ORG
MSG5 DC CL100' '
ORG MSG5
DC C'$EXT1205W SPOOL OVERFLOWED TO JOB '
MSG5_JOBNAME DC CL8' '
ORG
MSG6 DC CL100' '
ORG MSG6
DC C'$EXT1206E THE USERID FOR '
MSG6_JOBNAME DC CL8' '
DC C' COULD NOT BE FOUND'
ORG
MSG7 DC CL100' '
ORG MSG7
DC C'$EXT1207I FENCING IS NOT ACTIVE TO SYSTEM '
MSG7_SYSID DC CL4' '
ORG
MSG8 DC CL100' '
ORG MSG8
DC C'$EXT1208I REPLY "R" TO RETRY OR "C" TO CANCEL '
DC C'THE SPOOL PARTITIONING FOR '
MSG8_JOBTYPE DC CL3' '
DC C' '
MSG8_JOBNAME DC CL8' '
ORG
MSG9 DC CL100' '
ORG MSG9
DC C'$EXT1209I NO SPOOL VOLUMES AVAILABLE FOR '
MSG9_JOBTYPE DC CL3' '
DC C' '
MSG9_JOBNAME DC CL8' '
DC C'. SEARCHING '
MSG9_VOLTYPE DC CL7' '
DC C' VOLUMES'
ORG
*/*******************************************************************/*
*/* DEFINE Z/OS MAPPING MACROS */*
*/*******************************************************************/*
EJECT
LTORG
IEESMCA
$MODEND
END
E.4 Other code used by exits
The CLEAR macro that is used by both JES2 exits to clear used work areas is shown in Example E-5.
Example E-5 CLEAR macro that is used by JES2 exits samples
MACRO
&LABEL CLEAR &FIELD
LCLA &A
&LABEL MVI &FIELD,C' '
MVC &FIELD+1(L'&FIELD-1),&FIELD
MEND
The Example 6-46 shows the GETMSG sample macro used by JES2 exits to get messages from message pool.
Example 6-46 Sample of GETMSG macro
MACRO
&NOME GETMSG &MSG,&AREA,&CSECT
LCLA &A
&NOME LA 15,&MSG
BCTR 15,0
MH 15,=AL2(L'&AREA)
AIF ('&CSECT'(1,1) EQ '(').REGOK
A 15,=A(&CSECT)
AGO .MOVE
.REGOK ANOP
&REG SETC '&CSECT'(2,1)
&REGNO SETA &REG
AR 15,&REGNO
.MOVE ANOP
MVC &AREA+0(L'&AREA),0(15)
.EXIT MEND
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset